|
-
Dec 27th, 2002, 05:22 AM
#1
How to make the ShowDialog method return a custom object
Everyone else probably already knows this but I just needed a form to return an object as a result and so I found a way to do it. Before I've used delegates to call a method when the form was closing or used a ByRef variable, however the delegate isn't ideal for most situations and the ByRef sometimes didn't work. So this is an example of Shadowing the ShowDialog method to return your own object instead of DialogResult. I hope someone finds it useful. You could also use this method for a custom MsgBox which came up here not too long ago.
-
Dec 27th, 2002, 05:44 AM
#2
Fanatic Member
Hi Edneeis
I tried it and its
Using VB.NET 2003/.NET 1.1/C# 2.0
http://del.icio.us/rajoo
Blow your mind, smoke gunpowder
Ashes to ashes, dust to dust
If God won't have you, the devil will. - Author unknown
Don't follow me, I'm lost too ...
-
Mar 6th, 2004, 08:49 PM
#3
Fanatic Member
THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU
I've been working with this all day (I just got 2003 .NET yesterday) and kept getting StackOverload errors in the calling form. I was not aware of the MyBase keyword so I was using what I knew, which as you might of guessed, was Me. Changed it and all is well.
Did I say Thank You?
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
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
|