473,395 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

I want to create multiple instances of a form and then refer to individual instances.

I have been writing a datalogging application. It reads in double's
into a database. I want to be able to click on a row in a database
(holds name of variable and also current value of variable) and then
instantiate a new form.

I created a new form form2 and then just on double click on a
button....

dim form as new form2
form.show

this allows me to create individual forms which I feed particular
variables.

now the issue for me is, how do i refer to each instance of form2
(want to be able to create form instances dynamically) individually.
i want to be able to send updated data from the database to each
window instance so that I can display multiple pieces of information
in individual scaleable windows..

is there a way to refer to a single instance of a new form?

Apr 13 '07 #1
6 1793
Savante,

Each time you create a new form you could add it to a collection, such as an
array, arraylist, list, hashtable, dictionary, etc.

Then you could refer to it by using an index or key.

Kerry Moorman
"Savante" wrote:
I have been writing a datalogging application. It reads in double's
into a database. I want to be able to click on a row in a database
(holds name of variable and also current value of variable) and then
instantiate a new form.

I created a new form form2 and then just on double click on a
button....

dim form as new form2
form.show

this allows me to create individual forms which I feed particular
variables.

now the issue for me is, how do i refer to each instance of form2
(want to be able to create form instances dynamically) individually.
i want to be able to send updated data from the database to each
window instance so that I can display multiple pieces of information
in individual scaleable windows..

is there a way to refer to a single instance of a new form?

Apr 13 '07 #2
On Apr 13, 1:20 pm, Kerry Moorman
<KerryMoor...@discussions.microsoft.comwrote:
Savante,

Each time you create a new form you could add it to a collection, such as an
array, arraylist, list, hashtable, dictionary, etc.

Then you could refer to it by using an index or key.

Kerry Moorman

"Savante" wrote:
I have been writing a datalogging application. It reads in double's
into a database. I want to be able to click on a row in a database
(holds name of variable and also current value of variable) and then
instantiate a new form.
I created a new form form2 and then just on double click on a
button....
dim form as new form2
form.show
this allows me to create individual forms which I feed particular
variables.
now the issue for me is, how do i refer to each instance of form2
(want to be able to create form instances dynamically) individually.
i want to be able to send updated data from the database to each
window instance so that I can display multiple pieces of information
in individual scaleable windows..
is there a way to refer to a single instance of a new form?- Hide quoted text -

- Show quoted text -
thanks for the reply.

I had a bash at this last night again - had a module with
dim arrayform(100) as form1 ' (form1 is the copy of the data display
window)
and then when I click a button in frmmain it goes somthing like.

public sub button1.click......
i+=1
arrayform(i)=new form
arrayform(i).show

is this what you mean? It seems to allow me to refer to particular
windows now I think. I was going to adjust the form1_closing such
that it simply hides the window rather than deletes it and then use
the value of i as a key to identify when tooo many form1 instances
were open?

Best Regards,

Grant

Apr 14 '07 #3
Grant,

Yes, that is one of the approaches that I was suggesting.

Another option would be to add each form to an arraylist or list. Then you
would not have to manage the size of the collection. Each new form could be
added to the collection without having to keep track of the size of the
collection or the index value, etc.

Kerry Moorman
"Savante" wrote:
>
thanks for the reply.

I had a bash at this last night again - had a module with
dim arrayform(100) as form1 ' (form1 is the copy of the data display
window)
and then when I click a button in frmmain it goes somthing like.

public sub button1.click......
i+=1
arrayform(i)=new form
arrayform(i).show

is this what you mean? It seems to allow me to refer to particular
windows now I think. I was going to adjust the form1_closing such
that it simply hides the window rather than deletes it and then use
the value of i as a key to identify when tooo many form1 instances
were open?

Best Regards,

Grant

Apr 14 '07 #4
Kerry,

Cheers,

How do I do that? :-(

in module -
dim grantform as arraylist?

and then in the class........

grantform as new form1
grantform.show?

how do I keep track of each instance of each form as it's
instanciated?

Best Regards,

Grant

Apr 15 '07 #5
On Apr 14, 4:34 pm, Kerry Moorman
<KerryMoor...@discussions.microsoft.comwrote:
Grant,

Yes, that is one of the approaches that I was suggesting.

Another option would be to add each form to an arraylist or list. Then you
would not have to manage the size of the collection. Each new form could be
added to the collection without having to keep track of the size of the
collection or the index value, etc.

Kerry Moorman

"Savante" wrote:
thanks for the reply.
I had a bash at this last night again - had a module with
dim arrayform(100) as form1 ' (form1 is the copy of the data display
window)
and then when I click a button in frmmain it goes somthing like.
public sub button1.click......
i+=1
arrayform(i)=new form
arrayform(i).show
is this what you mean? It seems to allow me to refer to particular
windows now I think. I was going to adjust the form1_closing such
that it simply hides the window rather than deletes it and then use
the value of i as a key to identify when tooo many form1 instances
were open?
Best Regards,
Grant- Hide quoted text -

- Show quoted text -
Kerry,

This opens up another can of worms. I've done the following

in module - friend formlist as arraylist

in each instance of opening a new form I've gone

dim instanceform as form
instanceform=new form
formlist.add(instanceform)

and so I'm presuming that this adds each instance of the form
instantiation to arraylist at a unique index position.

I would like to be able to change values in each instance of the form
using database values, but my question is how do I address the (for
example) label1.text parameter of each particular instance of the
form?

formlist(1).label1.text="whatever data I like". . . . .?

Apr 15 '07 #6
On Apr 15, 2:00 pm, "Savante" <grant.thom...@savante.co.ukwrote:
On Apr 14, 4:34 pm, Kerry Moorman

<KerryMoor...@discussions.microsoft.comwrote:
Grant,
Yes, that is one of the approaches that I was suggesting.
Another option would be to add each form to an arraylist or list. Then you
would not have to manage the size of the collection. Each new form could be
added to the collection without having to keep track of the size of the
collection or the index value, etc.
Kerry Moorman
"Savante" wrote:
thanks for the reply.
I had a bash at this last night again - had a module with
dim arrayform(100) as form1 ' (form1 is the copy of the data display
window)
and then when I click a button in frmmain it goes somthing like.
public sub button1.click......
i+=1
arrayform(i)=new form
arrayform(i).show
is this what you mean? It seems to allow me to refer to particular
windows now I think. I was going to adjust the form1_closing such
that it simply hides the window rather than deletes it and then use
the value of i as a key to identify when tooo many form1 instances
were open?
Best Regards,
Grant- Hide quoted text -
- Show quoted text -

Kerry,

This opens up another can of worms. I've done the following

in module - friend formlist as arraylist

in each instance of opening a new form I've gone

dim instanceform as form
instanceform=new form
formlist.add(instanceform)

and so I'm presuming that this adds each instance of the form
instantiation to arraylist at a unique index position.

I would like to be able to change values in each instance of the form
using database values, but my question is how do I address the (for
example) label1.text parameter of each particular instance of the
form?

formlist(1).label1.text="whatever data I like". . . . .?- Hide quoted text -

- Show quoted text -
awesome!! thanks!

Apr 16 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Daylor | last post by:
in win32 process , when u create new process,u have new main thread. i know,appDomain r logical procces,that exists in 1 win32 process. the q: is there way to create second appDomain (the...
0
by: fchef | last post by:
I am looking for some advice on working with Multiple frame instances. Essentially I need to be able to refer to specific control values in a frame and be able to hide/show a specific frame. In VB...
12
by: (Pete Cresswell) | last post by:
I know I can open many instances of a given form, but I've never done it. Now I'm analyzing an application where that seems like just the ticket: Many investment funds, *lots* of data points for...
2
by: Helen Trim | last post by:
I have an application with three forms that are msde visible and activated when needed. It uses Word to open documents and one of the forms is opened as the Word document is closed in the...
4
by: GGerard | last post by:
Hello I have a program where the user can open as many instances of a form as the user wants. The only limit to how many instances can be opened is determined by the limit of the computer...
5
by: c676228 | last post by:
Hi everyone, my colleagues are thinking about have three insurance plans on one asp page: I simplify the plan as follow: text box:number of people plan1 plan2 plan3
5
by: Neil | last post by:
"lyle" <lyle.fairfield@gmail.comwrote in message news:48c3dde7-07bd-48b8-91c3-e157b703f92b@f3g2000hsg.googlegroups.com... Question for you. I'm doing something similar, only, instead of opening...
4
by: nottarealaddress | last post by:
I'm trying to get my feet wet in VB2005 (our new standard at work after officially stopping new development in VB6 about a month ago). I'm working with a simple sql 2005 table of 50 entries, one...
5
by: pgrazaitis | last post by:
I cant seem to get my head wrapped around this issue, I have myself so twisted now there maybe no issue! Ok so I designed a class X that has a few members, and for arguments sake one of the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.