|
-
Aug 1st, 2003, 12:05 PM
#1
Thread Starter
Lively Member
Loading a form - should be SIMPLE???
I'm having quite a time trying to do just the simplest of things with .NET. I have a main form. When the user deletes an item on that form I want a message box to load. (Yes, I created a form displaying a message box because .NET does not allow us to change the properties of the message box & I wanted the back color etc. to change.) How do I get the 2nd form to show??? I've tried:
Dim frmMsgBox As New Form()
frmMsgBox.Show()
This does not work. The form never loads. How is everyone else doing this?
Thanks,
Corinne
-
Aug 1st, 2003, 12:59 PM
#2
you shouldnt be Dimming it as a New Form , but as a New Form2 ( or what ever the other form is called ) eg:
VB Code:
Dim frm As New Form2() '/// not Dim frm As New Form()
frm.Show()
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Aug 1st, 2003, 02:00 PM
#3
Thread Starter
Lively Member
Thank you so much fro responding. Could you please explain this to me so I understand it better? Why form2 and not form? I tried your suggestion ( as new form2) and the form never loaded. What now?
Thanks,
Corinne
-
Aug 1st, 2003, 02:22 PM
#4
Try this:
VB Code:
Dim frm As New frmMsgBox
frm.Show()
Forms are now objects the same as all other objects so you must make an instance of the specific form type. Hence you have to use the actual name of the specific form type instead of just the generic Form object they inherit from.
-
Aug 1st, 2003, 02:38 PM
#5
Sleep mode
Dim whatever as yourformmsgbox . whatever will hold the variable name of your messagebox form . Just change 'yourformmsgbox' with the name of your second form .
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
|