Click here to Skip to main content
15,902,299 members
Home / Discussions / C#
   

C#

 
GeneralRe: query dataset Pin
xrado22-Jun-05 3:17
xrado22-Jun-05 3:17 
GeneralRe: query dataset Pin
Paul Brower22-Jun-05 3:46
Paul Brower22-Jun-05 3:46 
GeneralRe: query dataset Pin
david cohoon22-Jun-05 7:55
david cohoon22-Jun-05 7:55 
GeneralRe: query dataset Pin
Anonymous22-Jun-05 8:08
Anonymous22-Jun-05 8:08 
GeneralC# MDI parent form & mdi form childs questions...urgent help please! Pin
GianlucaSeno22-Jun-05 0:49
GianlucaSeno22-Jun-05 0:49 
GeneralRe: C# MDI parent form & mdi form childs questions...urgent help please! Pin
sreejith ss nair22-Jun-05 2:57
sreejith ss nair22-Jun-05 2:57 
GeneralRe: C# MDI parent form & mdi form childs questions...urgent help please! Pin
GianlucaSeno22-Jun-05 3:42
GianlucaSeno22-Jun-05 3:42 
GeneralRe: C# MDI parent form & mdi form childs questions...urgent help please! Pin
david cohoon22-Jun-05 7:19
david cohoon22-Jun-05 7:19 
Instead of creating a new FORM2 everytime when the button is clicked, create a member variable of type FORM2 in FORM1, initializing it to null. In the event handler, test against null before creating the second form.

<br />
public class FORM1: System.Windows.Forms.Form<br />
{<br />
private FORM2 _secondForm = null;<br />
<br />
private void btnOk_Click(object sender, System.EventArgs e)<br />
{<br />
if (this._secondForm == null)<br />
{<br />
this._secondForm = new FORM2();<br />
this._secondForm.MdiParent = this.MdiParent;<br />
}<br />
<br />
this._secondForm.Show();<br />
}<br />
}<br />


This is just a simple fix, usually I try to have my mdi container manage my form instances.


In regards to your question regarding the second form accessing the first's textbox text, you could have the first form pass the second form a reference to itself. Again, this is much cleaner by having the MdiContainer manage interactions between child forms.


-cursor
GeneralRe: C# MDI parent form &amp; mdi form childs questions...urgent help please! Pin
GianlucaSeno22-Jun-05 7:42
GianlucaSeno22-Jun-05 7:42 
GeneralRe: C# MDI parent form &amp; mdi form childs questions...urgent help please! Pin
Anonymous22-Jun-05 11:18
Anonymous22-Jun-05 11:18 
GeneralPOS system Pin
Carl-Johan Larsson21-Jun-05 23:19
Carl-Johan Larsson21-Jun-05 23:19 
Generalcustom treeview structure Pin
deep721-Jun-05 23:16
deep721-Jun-05 23:16 
GeneralRe: custom treeview structure Pin
Dave Kreskowiak22-Jun-05 5:46
mveDave Kreskowiak22-Jun-05 5:46 
GeneralManipulate Windows Explorer folder properties dialog Pin
Ligblou21-Jun-05 23:03
Ligblou21-Jun-05 23:03 
GeneralRe: Manipulate Windows Explorer folder properties dialog Pin
Ligblou22-Jun-05 3:42
Ligblou22-Jun-05 3:42 
GeneralRe: Manipulate Windows Explorer folder properties dialog Pin
Dave Kreskowiak22-Jun-05 5:33
mveDave Kreskowiak22-Jun-05 5:33 
GeneralRe: Manipulate Windows Explorer folder properties dialog Pin
Ligblou22-Jun-05 22:11
Ligblou22-Jun-05 22:11 
GeneralRe: Manipulate Windows Explorer folder properties dialog Pin
Dave Kreskowiak22-Jun-05 5:28
mveDave Kreskowiak22-Jun-05 5:28 
GeneralRe: Manipulate Windows Explorer folder properties dialog Pin
Ligblou22-Jun-05 22:14
Ligblou22-Jun-05 22:14 
GeneralRichTextbox Problem Pin
heavenamour21-Jun-05 22:35
heavenamour21-Jun-05 22:35 
Generalsimple question or not Pin
raf9521-Jun-05 22:29
raf9521-Jun-05 22:29 
GeneralRe: simple question or not Pin
Sebastian Schneider21-Jun-05 23:21
Sebastian Schneider21-Jun-05 23:21 
GeneralC # chat Application Pin
idreesbadshah21-Jun-05 22:00
idreesbadshah21-Jun-05 22:00 
GeneralAdding handler to event without knowing it's name Pin
Piotrus21-Jun-05 21:57
Piotrus21-Jun-05 21:57 
GeneralRe: Adding handler to event without knowing it's name Pin
mav.northwind22-Jun-05 2:26
mav.northwind22-Jun-05 2:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.