how can i handle the mouse button on my form, wherever the user clicks??
like one command to all itens of the screen!!!
Thank you,
Guilherme Costa
Printable View
how can i handle the mouse button on my form, wherever the user clicks??
like one command to all itens of the screen!!!
Thank you,
Guilherme Costa
You could loop through every control on the form and attempt to add an OnClick handler.
VB Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For Each c As Control In Controls Try AddHandler c.Click, New EventHandler(AddressOf GenericClickHandler) Catch End Try Next End Sub Private Sub GenericClickHandler(ByVal sender As Object, ByVal args As System.EventArgs) MsgBox(sender.name) End Sub
Something like that.