Results 1 to 8 of 8

Thread: Forms from 6.0 to .Net

  1. #1

    Thread Starter
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961

    Question Forms from 6.0 to .Net

    I have prepared a project in VB 6.0. Later on I upgraded it to VB .Net.

    To call a form, the code 'MyForm1.show' was upgraded to 'MyForm1.DefInstance.Show()'. Now I added a new form in my .Net project.

    My question is how to call the newly added form in the project. Because MyNewForm.Show or MyNewForm.DefInstance.Show method is not available.

    Pls guide.

    Regards,

    Prakash

  2. #2
    Lively Member Edilson's Avatar
    Join Date
    Aug 2000
    Location
    Orlando
    Posts
    81
    Are you using MDI ??

  3. #3

    Thread Starter
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961
    yes, i am using MDI

  4. #4
    Addicted Member
    Join Date
    Aug 2002
    Location
    Belfast, N. Ireland
    Posts
    167
    You need to create an instance of your new form,

    VB Code:
    1. Dim f As New MyNewForm
    2. f.show

  5. #5
    Hyperactive Member sw_is_great's Avatar
    Join Date
    Nov 2003
    Posts
    330
    Hi
    There is nothing to do with MDI.
    In VB .NET , you need to always create an instance for that.

    So , please do something like this

    Dim frmnew as new FORM2

    frmnew.show 'non modal

    OR

    frmnew.showDialogue ' modal
    Regards

  6. #6
    Lively Member Edilson's Avatar
    Join Date
    Aug 2000
    Location
    Orlando
    Posts
    81
    yes, there's some diference, in MDI you have to declare the form's parent, if not when you minimize the MDI, the new form will show on the desktop.

    so ...
    dim f as new MyForm
    f.parent=Mymdi ' ( Me )
    f.show

  7. #7
    Hyperactive Member sw_is_great's Avatar
    Join Date
    Nov 2003
    Posts
    330
    Thanks a lot . I totally overlooked that point
    Regards

  8. #8
    Hyperactive Member sw_is_great's Avatar
    Join Date
    Nov 2003
    Posts
    330
    Regards

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