Solved

VB: HOW TO LOAD THE SAME FORM TWICE??

Posted on 2004-04-12
8
442 Views
Last Modified: 2006-11-17
Hi all,

I have an application that a "father" and his "son" are using the same form.  The only difference is I used a boolean to identify whether this is "father" or "son".  The question is how can I open / load "father" and "son" simultaneously.

Should I need to write class to do it?? If so, any sample code??

This is quite urgent for me.  Thanks all, man / girls!!! ^_^
0
Comment
Question by:wbmsc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 27

Expert Comment

by:Dabas
ID: 10804339
Hi wbmsc:
VB6? VB.NET?
Also not clear what you mean by "father" and "son"

Dabas
0
 

Author Comment

by:wbmsc
ID: 10804366
VB6.  Oh sorry... May be I ask the question in this way.  How can I open the same form twice, let's say "frmCustomer", simultaneously and appear on the screen??

B Rgds,
Kenny

0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 10804368
You need to define a New Form Object:

Example:

In vb 6:

Dim frm As New Form1
    frm.Show

in vb.net

Dim frm As New Form1()
            frm.Show()
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 52

Accepted Solution

by:
Ryan Chong earned 50 total points
ID: 10804371
so, try this:

Dim frmSon As New frmCustomer
frmSon.Show

Dim frmParent As New frmCustomer
frmParent.Show

cheers :-)
0
 
LVL 27

Expert Comment

by:Dabas
ID: 10804377
wbmsc:
I support ryancys second answer

Dabas
0
 

Author Comment

by:wbmsc
ID: 10804396
Thanks ryancys, it exactly what I looking for and I can now open the same form with different parameters into it.

As I seldom to use the form as a new object, so ask a stupid question... Thanks, by the way.

Cheers!! ^_^

Kenny
0
 

Author Comment

by:wbmsc
ID: 10804466
Well, but another question is, if I call frmFather.DisplayResult and frmSon.DisplayResult, all the global variables are not properly recognized.

For instance, I have
Public mstrButtonName as string

Option Explicit
.
.
.

However, when I try to locate frmFather.mstrButtonName, it returns me a null value.  Is there any more stuff that I need to pay attention?
0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 10806405
>>if I call frmFather.DisplayResult and frmSon.DisplayResult, all the global variables are not properly recognized.
If you mean to use same variable in all of the forms (modules) in your application, you can declare the variable in the Module. Try add in a Module, then declare your variable there:

Public mstrButtonName as string

Glad could make helps ;-) cheers
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to share My.Settings in multiple application instances ? 7 79
Hide file extensions in Notepad++ tabs 2 84
Java pass by reference 3 74
MySQL programmer starter 25 65
This article will show, step by step, how to integrate R code into a R Sweave document
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question