CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 1999
    Posts
    16

    URGENT : Loading forms using formnames in strings

    Is it possible to load using a formname in a string variable
    For eg.,
    <vbcode>
    strFormName = "Form1"
    Load strFormName
    </vbcode>

    Please send me a solution for this !!



  2. #2
    Join Date
    Sep 1999
    Posts
    202

    Re: URGENT : Loading forms using formnames in strings

    Here it is. Without SP3 for VB6, it won't work when compiled.

    private Sub Form_Click()
    Dim x as Form
    set x = Forms.Add("Form2")
    x.Show
    End Sub
    ' or
    private Sub Form_Click()
    Forms.Add("Form2").Show
    End Sub
    ' or
    private Sub Form_Click()
    Dim x as Form
    set x = CallByName(Forms, "Add", VbMethod, "Form2")
    x.Show
    End Sub




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

Featured