473,385 Members | 1,396 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,385 software developers and data experts.

Adding Form2

Rob
I want to add a second Windows Form to my app, but do not
know how to implement communication between the 2 Forms.
I want to be able to open and close Form2 from a button on
Form1 and need to know if Form2 is open or closed. Also,
I would like to open and close Form2 without causing logic
conflicts on Form1. I know in Visual J++6 they use an
interface to communicate between 2 Forms. My question is
How ? How do the 2 Forms communicate with one another ?
Please help RS.
Nov 20 '05 #1
3 1138
Hi Rob,

When you really want to open and close it from everywhere then you get fast
strange not logical situations.

I think it is better to make form2 visable or/and hide it from your form1
and from your form2.

Just my thought.

Cor
Nov 20 '05 #2
* "Rob" <rl*****@worldnet.att.net> scripsit:
I want to add a second Windows Form to my app, but do not
know how to implement communication between the 2 Forms.
I want to be able to open and close Form2 from a button on
Form1 and need to know if Form2 is open or closed. Also,
I would like to open and close Form2 without causing logic
conflicts on Form1.


In the simplest case, you will have to pass a reference to the other
form. This reference can be used to close the form.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3
This article was very helpful to me on understanding how to work with Forms
in VB.Net

This article was provided to me by Cor Ligrhert, Thanks very much.

You may want to read the following MSDN article.
http://msdn.microsoft.com/library/de...adingToNET.asp
"Rob" <rl*****@worldnet.att.net> wrote in message
news:eT**************@TK2MSFTNGP09.phx.gbl...
I want to add a second Windows Form to my app, but do not
know how to implement communication between the 2 Forms.
I want to be able to open and close Form2 from a button on
Form1 and need to know if Form2 is open or closed. Also,
I would like to open and close Form2 without causing logic
conflicts on Form1. I know in Visual J++6 they use an
interface to communicate between 2 Forms. My question is
How ? How do the 2 Forms communicate with one another ?
Please help RS.

Nov 20 '05 #4

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

Similar topics

2
by: lkr | last post by:
i have created one windows application form (form1) in vc# . there is one listbox in that form. i have anothere form( form2). From form2 i have give one button. on the click event of that button i...
3
by: Raghavendra Mudugal | last post by:
Hello, I have two forms (Form1 and Form2) . Form1 contains one Combobox and a button which calls the second form on on_click event. In second form I have a textbox and a button. on click of...
3
by: Tom McL. | last post by:
My Program has two forms From1 and Form2. On From1 I have a TabControl1 witch has 8 tabs currently. I would like to add a new tab from Form2 is this possible? I have tried the following code on...
0
by: Kulbir | last post by:
I am a beginner in C#.net Windows programming. I have two forms - Form1 and Form2. On Form1, I have a splitter. In one of the panel of splitter, I have put a Panel Control(Panel2). I have...
1
by: =?Utf-8?B?UmVnaXMgRm9udGVz?= | last post by:
Hi, I have the following code, that worked OK with Visual Studio 2003: Form2 v_Frm2 = new Form2(); m_pnlForms.Controls.Add(v_Frm2); v_Frm2.Show(); v_Frm2.BringToFront(); It makes Form2 to...
5
by: lukasmazur | last post by:
Hi I have a problem with using listBox1. I have a two forms form1 and form2. In form1 are controls listBox1, textBox1 and button witch creating object of class Form2. In class Form2 I create a...
1
by: RobcPettit | last post by:
Hi, I have two forms. From form1(frmMain) I want to add tabpages to Form2. In form1 I have: frmMain tbe = new frmMain(); Thread thread = new Thread(new ThreadStart(tbe.AddTab));...
4
by: Jonny Relentless | last post by:
After adding a form to a C# program, I am unable to use it. I want to use form1 as a sort of menu, so that when the user clicks a button, form1 will close and form2 (or form3, etc) will open. What...
3
by: raylopez99 | last post by:
Oh, I know, I should have provided complete code in console mode form. But for the rest of you (sorry Jon, just kidding) I have an example of why, once again, you must pick the correct entry point...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.