Solved

VB: HOW TO LOAD THE SAME FORM TWICE??

Posted on 2004-04-12
8
446 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
A short article about problems I had with the new location API and permissions in Marshmallow
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

631 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