1. How can I see if a form has been moved?
Resize doesn't help.
2. How can I make a form act like a dialogbox as msgbox?
Printable View
1. How can I see if a form has been moved?
Resize doesn't help.
2. How can I make a form act like a dialogbox as msgbox?
An answer to your first question:
That resets the forms position every time you move it.Code:' Create a timer and call it "CheckForm"
' Then plug this in
'In General Declarations
Dim FormX, FormY As Double
Private Sub Form_Load()
FormX = YourForm.Left
FormY = YourForm.Top
CheckForm.Enabled = True
CheckForm.Interval = 200
End Sub
Private Sub CheckForm_Timer()
If YourForm.Left <> FormX Then
YourForm.Left = FormX
End If
If YourForm.Top <> FormY Then
YourForm.Top = FormY
End If
End Sub
In regards to your second question, if I understand it you want to use a form to present info in a message box style.
One way to do this is to create a form with the info you want and the size you want and change its border style to 4-FixedToolWindow which means that it can't be resized and gives it the look of a message box. When you want it to show, use the vbModal command so that the user can't flick between forms until he has acknowledged the message-form, e.g.
frmMessage.Show vbModal
Hope this helps