954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Closing forms by cliking 'X' in VB.NET 2003 after showing some confirmation

Hi, there, all fellow programmers I need a help on this. I have a code in vb6. It acts when a click action is made on 'X' on form1. Here is the code :-

private sub form1_unload(cancel as integer)
dim confirm as integer

confirm=msgbox("Sure to exit ?",vbyesno+vbquestion,"Confirm Exit")
if confirm=vbyes then
end
elseif confirm=vbno then
cancel=vbno
exit sub
endif
end sub


The above code works fine in vb6 environment. Now I need to write similar code in vb.net 2003 also. Does anybody have any idea how to do this? Plz this is urgent. Reply me as soon as possible

choudhuryshouvi
Posting Pro
553 posts since May 2007
Reputation Points: 30
Solved Threads: 49
 

Hi all,
Atlast I've rewritten the above code in vb.net 2003 and its working great.

Thanks once again...

choudhuryshouvi
Posting Pro
553 posts since May 2007
Reputation Points: 30
Solved Threads: 49
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You