Click here to Skip to main content
15,885,216 members
Home / Discussions / C#
   

C#

 
AnswerRe: Compress with java decompress with c# Pin
Bernhard Hiller26-Feb-12 20:32
Bernhard Hiller26-Feb-12 20:32 
QuestionReading Null values in a byte array Pin
si_6924-Feb-12 1:24
si_6924-Feb-12 1:24 
AnswerRe: Reading Null values in a byte array Pin
Dave Kreskowiak24-Feb-12 4:07
mveDave Kreskowiak24-Feb-12 4:07 
AnswerRe: Reading Null values in a byte array Pin
Matt Meyer24-Feb-12 5:21
Matt Meyer24-Feb-12 5:21 
QuestionHow to filter record when combobox value is null Pin
polachan24-Feb-12 0:56
polachan24-Feb-12 0:56 
AnswerRe: How to filter record when combobox value is null Pin
Bernhard Hiller26-Feb-12 20:39
Bernhard Hiller26-Feb-12 20:39 
Questionaccessing the value of control between seperate Forms Pin
Fred 3424-Feb-12 0:10
Fred 3424-Feb-12 0:10 
AnswerRe: accessing the value of control between seperate Forms Pin
Smart Arab24-Feb-12 0:24
Smart Arab24-Feb-12 0:24 
Hello ,


In this example I will pass Textbox1.text in Form1 to Form2 TextBox1


Form1 Code :
C#
using System;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form2 frm2;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            frm2 = new Form2();
            frm2.MyVar = textBox1.Text;

            frm2.Show();
            
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if (frm2 != null)
            {
                frm2.MyVar = textBox1.Text;
            }
        }

	}
}



Form2 Code
C#
using System;
using System.Windows.Forms;

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

        public string MyVar
        {
            set
            {
                textBox1.Text = value;
            }
        }
    }
}

GeneralRe: accessing the value of control between seperate Forms Pin
Fred 3424-Feb-12 0:36
Fred 3424-Feb-12 0:36 
AnswerRe: accessing the value of control between seperate Forms Pin
Richard MacCutchan24-Feb-12 1:26
mveRichard MacCutchan24-Feb-12 1:26 
GeneralRe: accessing the value of control between seperate Forms Pin
Fred 3424-Feb-12 1:44
Fred 3424-Feb-12 1:44 
GeneralRe: accessing the value of control between seperate Forms Pin
lukeer24-Feb-12 2:10
lukeer24-Feb-12 2:10 
GeneralRe: accessing the value of control between seperate Forms Pin
Fred 3424-Feb-12 4:40
Fred 3424-Feb-12 4:40 
GeneralRe: accessing the value of control between seperate Forms Pin
Richard MacCutchan24-Feb-12 2:44
mveRichard MacCutchan24-Feb-12 2:44 
AnswerRe: accessing the value of control between seperate Forms Pin
Dave Kreskowiak24-Feb-12 4:12
mveDave Kreskowiak24-Feb-12 4:12 
GeneralRe: accessing the value of control between seperate Forms Pin
Fred 3424-Feb-12 4:46
Fred 3424-Feb-12 4:46 
GeneralRe: accessing the value of control between seperate Forms Pin
Dave Kreskowiak24-Feb-12 9:03
mveDave Kreskowiak24-Feb-12 9:03 
AnswerRe: accessing the value of control between seperate Forms Pin
Shameel24-Feb-12 8:25
professionalShameel24-Feb-12 8:25 
Questionhow to filter chart by textbox & dropdown ??? Pin
Jeeten Parmar24-Feb-12 0:08
Jeeten Parmar24-Feb-12 0:08 
QuestionExport To word problem Pin
helmidj23-Feb-12 22:16
helmidj23-Feb-12 22:16 
AnswerRe: Export To word problem Pin
Pete O'Hanlon23-Feb-12 22:24
mvePete O'Hanlon23-Feb-12 22:24 
GeneralRe: Export To word problem Pin
helmidj27-Feb-12 4:37
helmidj27-Feb-12 4:37 
QuestionAsp.net MVC Pin
santhosh.kumar8323-Feb-12 20:32
santhosh.kumar8323-Feb-12 20:32 
AnswerRe: Asp.net MVC Pin
Richard MacCutchan23-Feb-12 22:28
mveRichard MacCutchan23-Feb-12 22:28 
QuestionHow to set up dataGridView background image, or transparent background Pin
Member 860388323-Feb-12 18:19
Member 860388323-Feb-12 18:19 

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.