-
Questions..
How do i "detect" when someone clicks that X at the corner that closes the program?
Not so important but when you subtract or add to the width property does it stretch it right or left?(basically which side moves and which stays still?)
same question with hieght
well thats all for now
wait nevermind one more patheticly stupid question: What exactly is a module? I think its like creating functions, so when you put them in project you just type a small thing instead of lots of lines for complex things, am i wrong?
later,
Iceman
P.S. thanks to everyone here who helped me a while ago!
[Edited by Iceman on 03-28-2000 at 12:55 AM]
-
Usually the way to test if someone has clicked the X is because the Form_Unload event is triggered on that form.
What you can do is set the 'Cancel' variable to TRUE then it will not unload the form when it has completed running the code for the Form_Unload event.
This means you can effectively make tests, maybe put up msg boxes (ie Do you want to save? like word does) before it actually performs the terminate.
As for the other question...
All windows and objects are "pivoted" on the TOP LEFT of their rectangle. This means that by stating the TOP and the LEFT positions it will then continue to spread to the RIGHT based on the WIDTH and down based on the HEIGHT. Therefor changing the width OR the height will stretch/reduce it on the BOTTOM and the RIGHT edges respectively.
This is also true for circles, rectangles and anything else that has a surrounding box.
-
You'd be better off if you did the following in your form's QueryUnload event. You may not need to check for all the conditions, but you probably should at least consider if you still want to ask the user if he/she wants to exit if it's Windows or your code that is closing the form.
Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim retVal As Integer
Select Case UnloadMode
Case vbFormControlMenu
' The user chose the Close command from the Control menu on the form
retVal = MsgBox("Are you sure you want to exit?", vbYesNo, "Exit")
If retVal = vbYes Then
Cancel = True
End If
Case vbFormCode
' The Unload statement is invoked from code.
Case vbAppWindows
' The current Microsoft Windows operating environment session
' is ending.
Case vbAppTaskManager
' The Microsoft Windows Task Manager is closing the application.
Case vbFormMDIForm
' An MDI child form is closing because the MDI form is closing.
vbFormOwner
' A form is closing because its owner is closing.
End Select
End Sub