Link to home
Start Free TrialLog in
Avatar of computerg33k
computerg33k

asked on

Determining when the cursor enters a groupbox...

Currently I have:


Private Sub GbJobGroup_MouseMove(ByVal sender As Object, ByVal e As System.EventArgs) Handles gbJobGroup.Enter
txtComments.Size =

New System.Drawing.Size(936, 21)
txtComments.Location =

New System.Drawing.Point(40, 656)
btnComments.BringToFront()

txtComments.SendToBack()

tvMain.Size =

New System.Drawing.Size(16, 656)
BtnShowTV.BringToFront()

tvMain.SendToBack()


txtDiligentAttempts.Size =

New System.Drawing.Size(16, 656)
txtDiligentAttempts.Location =

New System.Drawing.Point(992, 48)

txtComments.Size =

New System.Drawing.Size(936, 21)
txtComments.Location =

New System.Drawing.Point(40, 656)
btnComments.BringToFront()

txtComments.SendToBack()

btnDiligentAttempts.BringToFront()

btnComments.BringToFront()

BtnShowTV.BringToFront()


End Sub
 

However, the code is not hit unless I click inside of the groupbox.  

This code is used to determine when to minimize a textbox that comes out vertically (there is one on the right, one on the left, and one on the bottom that opens up horizontally) like outlooks menus.  Current I use:

Private

Sub frmParent_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
XCord = e.X

YCord = e.Y


If XCord >= 9 Then
txtComments.Size =

New System.Drawing.Size(936, 21)
txtComments.Location =

New System.Drawing.Point(40, 656)
btnComments.BringToFront()

txtComments.SendToBack()

tvMain.Size =

New System.Drawing.Size(16, 656)
BtnShowTV.BringToFront()

tvMain.SendToBack()


Else
txtComments.Size =

New System.Drawing.Size(936, 21)
txtComments.Location =

New System.Drawing.Point(40, 656)
btnComments.BringToFront()

txtComments.SendToBack()

tvMain.Size =

New System.Drawing.Size(352, 656)
BtnShowTV.SendToBack()

tvMain.BringToFront()


End If

If XCord >= 991 Then
txtDiligentAttempts.Size =

New System.Drawing.Size(336, 656)
txtDiligentAttempts.Location =

New System.Drawing.Point(672, 48)
txtDiligentAttempts.BringToFront()

btnDiligentAttempts.SendToBack()


Else
txtDiligentAttempts.Size =

New System.Drawing.Size(16, 656)
txtDiligentAttempts.Location =

New System.Drawing.Point(992, 48)

End If

If XCord = 40 And YCord = 656 Then
txtComments.Size =

New System.Drawing.Size(936, 168)
txtComments.Location =

New System.Drawing.Point(40, 504)
txtComments.BringToFront()

btnComments.SendToBack()


Else
txtComments.Size =

New System.Drawing.Size(936, 21)
txtComments.Location =

New System.Drawing.Point(40, 656)
btnComments.BringToFront()

txtComments.SendToBack()


End If
btnDiligentAttempts.BringToFront()

btnComments.BringToFront()

BtnShowTV.BringToFront()


End Sub
 

To determine when the comment boxes should be 'stored away' or opened.  However, if the user goes straight from the comment box, to a group box, the comment boxes don't get 'stored away'.  

What can I use to determine when the mouse cursor enters the groupbox?
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Take a look at the MouseLeave() event as well...it may be more appropriate than using forms MouseMove() event (or maybe better to use them both in combination).

...but it's really hard to tell exactly what's going on with the code without visually being able to see your forms layout.
Avatar of computerg33k
computerg33k

ASKER

I could've sworn that it gave me an error when I tried that...grr...Thanks!
sorry about the delay in accepting the answer--could've sworn I did that yesterday when i made the previous post...