C
Colin McGuire
Hi, would someone be able to verify this crazy behaviour/
1. Launch VS.Net 2003, create a new project with a "Form1"
2. Add "Button1" to the form.
3. Paste in the code below.
When I move the cursor over the button & leave it there a while (for
the hover event to fire), the form displays. Note the position. I move
the cursor away from the button, then back onto it to fire the hover
event again, and for the second and all subsequent times, the form is
positioned in a different place to originally. So why it is not
displayed at 100,100 the first time, but for the second, third, fourth
etc?
Thank you (again)
Colin
Public Class Form1
Inherits System.Windows.Forms.Form
'Windows Form Designer generated code <start>
'
' <snip>
'
'Windows Form Designer generated code <end>
Dim frm As New Form
Private Sub hoverDisplayNewForm(ByVal sender As Object, _
ByVal e As System.EventArgs)
frm.Location = New Point(100, 100)
frm.Show()
End Sub
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
AddHandler Button1.MouseHover, AddressOf hoverDisplayNewForm
frm.Size = New Size(50, 50)
End Sub
End Class
1. Launch VS.Net 2003, create a new project with a "Form1"
2. Add "Button1" to the form.
3. Paste in the code below.
When I move the cursor over the button & leave it there a while (for
the hover event to fire), the form displays. Note the position. I move
the cursor away from the button, then back onto it to fire the hover
event again, and for the second and all subsequent times, the form is
positioned in a different place to originally. So why it is not
displayed at 100,100 the first time, but for the second, third, fourth
etc?
Thank you (again)
Colin
Public Class Form1
Inherits System.Windows.Forms.Form
'Windows Form Designer generated code <start>
'
' <snip>
'
'Windows Form Designer generated code <end>
Dim frm As New Form
Private Sub hoverDisplayNewForm(ByVal sender As Object, _
ByVal e As System.EventArgs)
frm.Location = New Point(100, 100)
frm.Show()
End Sub
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
AddHandler Button1.MouseHover, AddressOf hoverDisplayNewForm
frm.Size = New Size(50, 50)
End Sub
End Class