|
-
Jul 18th, 2001, 09:01 PM
#1
Thread Starter
Lively Member
VB equal to the Javascript "return false"
How could I make VB do "return false" as in javascript
something like this
<body onContextmenu="return false">
but in vb
-
Jul 18th, 2001, 09:04 PM
#2
Thread Starter
Lively Member
also how could I do this to Command1?
<input type="button" value="Command1" onFocus="if(this.blur)this.blur()">
how could I do something like that?
-
Jul 19th, 2001, 02:47 AM
#3
Retired VBF Adm1nistrator
VB works kinda differently....
Code:
Private Sub Command1_LostFocus()
If Not doSomething Then
'is the same as :
'If (doSomething = False) Then
MsgBox "doSomething returned false"
End If
End Sub
Private Function doSomething() As Boolean
'to return a value, you set the function/sub's name to the value
'same as return false
doSomething = False
End Function
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 19th, 2001, 02:50 AM
#4
1) The equivalent is a boolean value (take a look at this in the MSDN help file).
Basically, if you want to return false when a button's clicked, you could use something like the attachment.
2) You draw a button onto the form, then set the name and caption properties of this in the properties window in VB.
To get code to execute when the button's clicked, just double click on the button & you'll be taken to the code window.
Whatever you type between the "Private Sub Command1_Click()" and "End Sub"
will be run when the buttons clicked !
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
|