Hi there,
I seem to face some problems with multiple click event. When i click plotButton, it should plot a cross. For example if user select 250Hz, it will plot a cross at 250Hz. x and y are the pixel values to draw the cross. When the user select a different frequency (eg. 500Hz) and click plotButton again, the cross for the 250Hz will disappear. So how do i make it stay? I think it has got something to do with the plotButton click event.
[CODE=vbnet]Private Sub Audiogram_Paint (ByVal sender As Object, ByVal e As System.Windows. Forms.PaintEven tArgs) Handles Me.Paint
If BIEMaskingMachi ne.freqTrackBar .Value = 250 Then
If BIEMaskingMachi ne.count = -10 Then
x = 80
y = 50
G.DrawLine(Blue pen, (x - 5), (y - 5), (x + 5), (y + 5)) 'drawing 'x'
G.DrawLine(Blue pen, (x + 5), (y - 5), (x - 5), (y + 5))
xpoints(0) = G
End If
If BIEMaskingMachi ne.freqTrackBar .Value = 500 Then
If BIEMaskingMachi ne.toneLabel.Te xt = "-10dB" Then
x = 120
y = 50
H.DrawLine(Blue pen, (x - 5), (y - 5), (x + 5), (y + 5)) 'drawing 'x'
H.DrawLine(Blue pen, (x + 5), (y - 5), (x - 5), (y + 5))
xplotted500 = H
End If
End Sub[/CODE]
The plotButton is in a different form. This is the code for the plotButton.
[CODE=vbnet]Private Sub plotButton_Clic k(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles plotButton.Clic k
'Audiogram.Show Dialog()
Audiogram.Show( )
End Sub[/CODE]
I seem to face some problems with multiple click event. When i click plotButton, it should plot a cross. For example if user select 250Hz, it will plot a cross at 250Hz. x and y are the pixel values to draw the cross. When the user select a different frequency (eg. 500Hz) and click plotButton again, the cross for the 250Hz will disappear. So how do i make it stay? I think it has got something to do with the plotButton click event.
[CODE=vbnet]Private Sub Audiogram_Paint (ByVal sender As Object, ByVal e As System.Windows. Forms.PaintEven tArgs) Handles Me.Paint
If BIEMaskingMachi ne.freqTrackBar .Value = 250 Then
If BIEMaskingMachi ne.count = -10 Then
x = 80
y = 50
G.DrawLine(Blue pen, (x - 5), (y - 5), (x + 5), (y + 5)) 'drawing 'x'
G.DrawLine(Blue pen, (x + 5), (y - 5), (x - 5), (y + 5))
xpoints(0) = G
End If
If BIEMaskingMachi ne.freqTrackBar .Value = 500 Then
If BIEMaskingMachi ne.toneLabel.Te xt = "-10dB" Then
x = 120
y = 50
H.DrawLine(Blue pen, (x - 5), (y - 5), (x + 5), (y + 5)) 'drawing 'x'
H.DrawLine(Blue pen, (x + 5), (y - 5), (x - 5), (y + 5))
xplotted500 = H
End If
End Sub[/CODE]
The plotButton is in a different form. This is the code for the plotButton.
[CODE=vbnet]Private Sub plotButton_Clic k(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles plotButton.Clic k
'Audiogram.Show Dialog()
Audiogram.Show( )
End Sub[/CODE]
Comment