Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: running out of memory, issues with GC Pin
Jon Hulatt12-May-09 8:06
Jon Hulatt12-May-09 8:06 
GeneralRe: running out of memory, issues with GC Pin
Luc Pattyn12-May-09 9:19
sitebuilderLuc Pattyn12-May-09 9:19 
QuestionWorking with multiple forms Pin
bwood202012-May-09 5:34
bwood202012-May-09 5:34 
AnswerRe: Working with multiple forms Pin
OriginalGriff12-May-09 5:37
mveOriginalGriff12-May-09 5:37 
GeneralRe: Working with multiple forms Pin
bwood202012-May-09 5:56
bwood202012-May-09 5:56 
AnswerRe: Working with multiple forms Pin
DaveyM6912-May-09 5:49
professionalDaveyM6912-May-09 5:49 
GeneralRe: Working with multiple forms Pin
bwood202012-May-09 6:03
bwood202012-May-09 6:03 
GeneralRe: Working with multiple forms Pin
DaveyM6912-May-09 6:20
professionalDaveyM6912-May-09 6:20 
Keep a reference to the second form when you instanciate it and use that reference.
A simple example. Button on Form1, TextBox on Form2:
// Form1
using System;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        private Form2 form2;
        public Form1()
        {
            InitializeComponent();
            form2 = new Form2();
            form2.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (form2 != null)
                MessageBox.Show(form2.GD);
        }
    }
}
// Form2
using System;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            GD = textBox1.Text;
        }

        public string GD
        {
            get;
            set;
        }
    }
}


Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: Working with multiple forms Pin
bwood202012-May-09 7:17
bwood202012-May-09 7:17 
GeneralRe: Working with multiple forms Pin
Henry Minute12-May-09 7:28
Henry Minute12-May-09 7:28 
GeneralRe: Working with multiple forms Pin
bwood202012-May-09 9:13
bwood202012-May-09 9:13 
GeneralRe: Working with multiple forms Pin
Henry Minute12-May-09 9:22
Henry Minute12-May-09 9:22 
GeneralRe: Working with multiple forms Pin
bwood202012-May-09 9:48
bwood202012-May-09 9:48 
GeneralRe: Working with multiple forms Pin
Henry Minute12-May-09 10:00
Henry Minute12-May-09 10:00 
GeneralRe: Working with multiple forms Pin
bwood202012-May-09 11:10
bwood202012-May-09 11:10 
GeneralRe: Working with multiple forms Pin
Henry Minute12-May-09 11:54
Henry Minute12-May-09 11:54 
GeneralRe: Working with multiple forms Pin
bwood202013-May-09 4:02
bwood202013-May-09 4:02 
GeneralRe: Working with multiple forms Pin
bwood202013-May-09 6:20
bwood202013-May-09 6:20 
GeneralRe: Working with multiple forms Pin
Henry Minute13-May-09 6:38
Henry Minute13-May-09 6:38 
GeneralRe: Working with multiple forms Pin
bwood202014-May-09 9:49
bwood202014-May-09 9:49 
GeneralRe: Working with multiple forms Pin
Henry Minute14-May-09 10:46
Henry Minute14-May-09 10:46 
GeneralRe: Working with multiple forms Pin
DaveyM6912-May-09 8:09
professionalDaveyM6912-May-09 8:09 
QuestionI can't get latest value by ref parameter. WHY? [modified] Pin
codeadair12-May-09 5:26
codeadair12-May-09 5:26 
AnswerRe: I can't get latest value by ref parameter. WHY? Pin
Henry Minute12-May-09 5:39
Henry Minute12-May-09 5:39 
GeneralRe: I can't get latest value by ref parameter. WHY? Pin
codeadair12-May-09 14:57
codeadair12-May-09 14:57 

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.