how to capture a mouse move control in a container in vb.net 2005
-
Hi, I have a form with one textBox and a label, by default the label is disabled which contain some message. if textBox is disabled, when mouse move to this textbox area, the message is label is shown, if the mouse move out of the textbox area, the label is hide again. everything works fine if I put these two control in form. But if I create a groupbox in the form and put these two control to the groupbox, this doesnot work any more, why? how can I use mousemove to capture the control in a container? Thanks!
-
Hi, I have a form with one textBox and a label, by default the label is disabled which contain some message. if textBox is disabled, when mouse move to this textbox area, the message is label is shown, if the mouse move out of the textbox area, the label is hide again. everything works fine if I put these two control in form. But if I create a groupbox in the form and put these two control to the groupbox, this doesnot work any more, why? how can I use mousemove to capture the control in a container? Thanks!
Solve it. The MouseMove event must be set on the parent control. and when get the control from mousemove, should use following syntex: Private Sub GroupBox1_MouseMove() Dim parent As Control parent = sender Dim ctrl As Control ctrl = parent.GetChildAtPoint(e.Location) ......... end sub Thanks!