Results 1 to 5 of 5

Thread: Loading a form - should be SIMPLE???

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93

    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

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    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:
    1. Dim frm As New Form2() '/// not Dim frm As New Form()
    2. 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]

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93
    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

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Try this:
    VB Code:
    1. Dim frm As New frmMsgBox
    2. 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.

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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
  •  



Click Here to Expand Forum to Full Width