Hi
I am using a cdc control in an app. How do I pick up if the user has pressed the cancel button?
Thanking you in advance
PORRASTAR
Printable View
Hi
I am using a cdc control in an app. How do I pick up if the user has pressed the cancel button?
Thanking you in advance
PORRASTAR
the return string is "" if cancel is pressed
A better way to do it:
VB Code:
On Error GoTo EH: CommonDialog1.CancelError = True 'do your cd code here CommonDialog1.ShowOpen 'etc Exit Sub EH: If Err.Number = 32755 Then 'Cancel was pressed End If
Just make sure the CancelError property is set to true. You can set it at design time and take the first line of the code out where it sets it to true.
In this case, where you don't really need to "handle" the error, you could just use the On Error Resume Next statement.