Lostfocus event for Picture box.
Quote:
Private Picture_Boxes() As MyDevicePage_Picturebox
Private Sub MySkanPage_Picturebox_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.DoubleClick
MyBase.BorderStyle = Windows.Forms.BorderStyle.FixedSingle
End Sub
Private Sub MySkanPage_Picturebox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus
MyBase.BorderStyle = Windows.Forms.BorderStyle.None
End Sub
Hi friends,
I am adding pictureboxes to my form as shown in the code above. but the problem is lostfocus event is not working. Can anybody tell me were the problem is.Thanks in advance.
Regards,
Susheelss
Re: Lostfocus event for Picture box.
First up, you should generally handle the Enter and Leave events of a control rather than the GotFocus and LostFocus events. Apart from that, a PictureBox can't receive focus in the first place so it's not going to raise any of those four events.
Re: Lostfocus event for Picture box.
Thanks Mr.jmcilhinney. If that is the case with picture box then how can i change the image of the picture box clicked and change the image of any other picture box containing same image to any other as in case of option buttons.
Re: Lostfocus event for Picture box.
The PictureBox has a Click event. It just doesn't receive focus when you click it.