J
Jarek Mielcarek
hi,
I've problem to locate form on screen.
I'd like to show modal form near a textbox after user click on it.
here is the code:
Private Sub myTextBox_MouseDown(ByVal sender As Object, ByVal e As (...)
Dim r As New Rectangle(TextBox.Width, 1, 16, 18)
If r.Contains(New Point(e.X, e.Y)) Then
With popUp
.DesktopLocation = PointToScreen(New Point(r.Right - popUp.Size.Width,
r.Bottom + 2))
.Show()
End With
End If
End Sub
form popUp is hidden at start. after user click on textbox the popUp should
appear bottom of textbox.
and it does, but the first time popUp appear somewhere on the screen.
next I click on the textbox everything works fine.
the question is why it doesn't work first time?!
jaro
I've problem to locate form on screen.
I'd like to show modal form near a textbox after user click on it.
here is the code:
Private Sub myTextBox_MouseDown(ByVal sender As Object, ByVal e As (...)
Dim r As New Rectangle(TextBox.Width, 1, 16, 18)
If r.Contains(New Point(e.X, e.Y)) Then
With popUp
.DesktopLocation = PointToScreen(New Point(r.Right - popUp.Size.Width,
r.Bottom + 2))
.Show()
End With
End If
End Sub
form popUp is hidden at start. after user click on textbox the popUp should
appear bottom of textbox.
and it does, but the first time popUp appear somewhere on the screen.
next I click on the textbox everything works fine.
the question is why it doesn't work first time?!
jaro