Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA userforms

Status
Not open for further replies.

beridivya

Programmer
Sep 23, 2006
2
IN
Hi there

Can you Explain the following code-
Private Sub lstSheets_DblClick(ByVal Cancel As MSForms.ReturnBoolean).
I have confusion regarding the statement "ByVal Cancel As MSForms.ReturnBoolean".Why do we use the variable name "Cancel" here? Also tell me what happens when I pass the argument value "True" and when I pass the value "False".

thanks
Divya
 
beridivya,
Microsoft said:
The DblClick procedure is passed a True/False argument named Cancel. If code in the event procedure sets Cancel to True, the control ignores the second click. You would use this with controls, such as an OptionButton, for which clicking would change its value, and double-clicking would change its value twice, to return it to the original setting. By setting Cancel to True, you could have a double-click change the value of the control (because only the first click is registered) while still firing the DblClick event.

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top