Su33nf@yahoo.com
New member
- Joined
- Jun 10, 2008
- Messages
- 3
- Programming Experience
- 1-3
Hey. I have a program that dynamically makes panels inside a main panel called "pnlTest". I want to be able to select the panels inside the main one, but I am at a lost on how to do it.
I was thinking that selecting the child control by its location would be the best way to do this.
But when there are other objects in the main panel, "pnlTest", it stops getting the mouse position...
It only seems to work when there is nothing inside pnlTest... as so has the mouse goes over a child control it no longer picks up the mouse position.
is there anyway around this?
I was thinking that selecting the child control by its location would be the best way to do this.
VB.NET:
Private Sub pnlTest_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pnlTest.MouseClick
Dim pnlSelectPanel As Panel
Dim pntPosition as New Point (blXPoint.Text, lblYpoint.Text)
pnlSelectPanel = pnlTest.GetChildAtPoint(pntPosition,
GetChildAtPointSkip.None)
pnlSelectPanel.BorderStyle = BorderStyle.Fixed3D
End Sub
VB.NET:
Private Sub pnlTest_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pnlTest.MouseMove
Dim pntMousePosition As Point
pntMousePosition = pnlTest.PointToClient(MousePosition)
lblXPoint.Text = pntMousePosition.X
lblYpoint.Text = pntMousePosition.Y
is there anyway around this?