|
-
Aug 21st, 2000, 09:56 AM
#1
Thread Starter
Lively Member
Can someone give me the script for simple OK/cancel buttons on a form? With the focus on the OK button like Windows? That would be awesome!! Thanks!!
~Brian
-
Aug 21st, 2000, 09:59 AM
#2
Lively Member
Draw two buttons on the form. Name on cmdOK and the other cmdCancel.
Make the caption on cmdOK "&OK" and change the default property to "True".
Make the caption on cmdCancel "&Cancel".
-
Aug 21st, 2000, 11:14 AM
#3
Then place the statement Unload Me in cmdCancel.
Code:
Private Sub cmdCancel_Click()
'Unloads the Form
Unload Me
End Sub
-
Aug 21st, 2000, 11:17 AM
#4
Also if you set the Cancel property to True for the Cancel button the user can press the Escape key and the Click event will be raised.
-
Aug 21st, 2000, 02:46 PM
#5
_______
<?>
'<< or >>
Code:
'a command button called Quit
Private Sub Quit_Click()
Dim lResult As Long
lResult = (MsgBox("Do You Really Want To Quit?", vbYesNo, "Quit Application"))
If lResult = 6 Then
Dim Form As Form
For Each Form In Forms
Unload Form
Set Form = Nothing
Next Form
Else
Exit Sub 'or whatever you want to do
End If
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|