473,327 Members | 2,094 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,327 software developers and data experts.

First Main Form quick question.

Without using this:
For Each currentForm As Form In My.Application.OpenForms

or using something like me.mdi parent

how can i reference the main form's form variable.

Example:
If i open another form I can say:
dim bla as new frmForm2

i can now do bla.windowstate = blajsdfkljdslkjf

how can I ( in a submost form that is like 3 windows deep say somethign
like )

frmMainForm.minimize

its the frmMainForm variable I am having trouble with - since I dont
actaully define the first variable i dont have a reference to it.

I suppose I can make a public variable and when the main window opens put
the mainform's reference into it, but wondering if vb.net already has an
internal variable that holds the 'first' main form.

Thanks,

Miro

Nov 13 '08 #1
2 1411
There is a good description of this issue here:
http://www.devcity.net/PrintArticle.aspx?ArticleID=117

But more recently, see this:
http://www.panopticoncentral.net/arc...1/17/7052.aspx

Basically, the type name can be used to access a default instance.

"Miro" <mi**@beero.comwrote in message
news:O5****************@TK2MSFTNGP06.phx.gbl...
Without using this:
For Each currentForm As Form In My.Application.OpenForms

or using something like me.mdi parent

how can i reference the main form's form variable.

Example:
If i open another form I can say:
dim bla as new frmForm2

i can now do bla.windowstate = blajsdfkljdslkjf

how can I ( in a submost form that is like 3 windows deep say somethign
like )

frmMainForm.minimize

its the frmMainForm variable I am having trouble with - since I dont
actaully define the first variable i dont have a reference to it.

I suppose I can make a public variable and when the main window opens put
the mainform's reference into it, but wondering if vb.net already has an
internal variable that holds the 'first' main form.

Thanks,

Miro
Nov 13 '08 #2
Thank you James,

Thats exactly what I ended up doing, in the end.

However this article was helpful as I created a public module and not a
friend module.

Thank you,

Miro

"James Hahn" <jh***@yahoo.comwrote in message
news:uK**************@TK2MSFTNGP05.phx.gbl...
There is a good description of this issue here:
http://www.devcity.net/PrintArticle.aspx?ArticleID=117

But more recently, see this:
http://www.panopticoncentral.net/arc...1/17/7052.aspx

Basically, the type name can be used to access a default instance.

"Miro" <mi**@beero.comwrote in message
news:O5****************@TK2MSFTNGP06.phx.gbl...
>Without using this:
For Each currentForm As Form In My.Application.OpenForms

or using something like me.mdi parent

how can i reference the main form's form variable.

Example:
If i open another form I can say:
dim bla as new frmForm2

i can now do bla.windowstate = blajsdfkljdslkjf

how can I ( in a submost form that is like 3 windows deep say somethign
like )

frmMainForm.minimize

its the frmMainForm variable I am having trouble with - since I dont
actaully define the first variable i dont have a reference to it.

I suppose I can make a public variable and when the main window opens put
the mainform's reference into it, but wondering if vb.net already has an
internal variable that holds the 'first' main form.

Thanks,

Miro
Nov 13 '08 #3

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

Similar topics

3
by: A Future Computer Scientist | last post by:
I've gone through the newsgroups and I don't think I found the answer to my question. My question does anyone know the coding to show a form at runtime if it's not the first form created, since...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
3
by: Tyler Carver | last post by:
I am trying to use some dynamic controls that are built and then added to tables. The problem that I am having is the timing of when I can populate the controls and have the state remain after a...
7
by: Terry | last post by:
I have a Mainform with a Statusbar. When opening another form or doing some processing I want to display info in the Statusbar of the Mainform. I have read a lot of articles on this & have come up...
3
by: Kaur | last post by:
Hi, I would appriceate any help to correct the code error that I am getting for the onclick event of a cmd button. I have two forms. Main Form "frmQuestion" and form 2 "SfrmQuestion"....
0
by: byuphil | last post by:
My subform is displaying records from a table. Using the master-child links I am able to pass all of the necessary keys to show the correct information. When I try to select any item from a...
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I get the value of a form control? -----------------------------------------------------------------------...
3
by: stacey | last post by:
Hi all, I have a quick question about form classes. I am following this tutorial: http://www.evolt.org/article/PHP_Login_System_with_Admin_Features/17/60384/index.html Basically, it is a login...
9
by: Brad Pears | last post by:
I have the following code that references a "textbox" on a form. I want to pass the value of this textbox to a stored procedure as a parameter. This code is located on a different form obviously. I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.