vietoj
public Form1()
{
InitializeComponent();
Class1 klase = new Class1();
}
turetu buti
public Form1()
{
InitializeComponent();
klase = new Class1();
}
"Dziedukas" <dejau@gmail.com> wrote in message
news:k02jrp$90p$1@trimpas.omnitel.net...
> ne,nu jau nervai nelaiko, kame beda???
> public partial class Form1 : Form //pagrindine forma
> {
> public Form1()
> {
> InitializeComponent();
> Class1 klase = new Class1();
> }
>
> private void button1_Click(object sender, EventArgs e) //iki
> sito dar net nedaeina {
> label1.Text = klase.vardas;
> }
>
> private void button2_Click(object sender, EventArgs e)
> {
> Form2 forma2 = new Form2(klase);
>
> if (forma2.ShowDialog() == DialogResult.OK)
> {
>
> }
> }
> public Class1 klase { get; set; }
> }
>
> antra forma
> public partial class Form2 : Form
> {
> Class1 _klase = new Class1();
>
> public Form2(Class1 klase)
> {
> InitializeComponent();
> _klase = klase;
> }
> private void button1_Click(object sender, EventArgs e)
> {
> _klase.vardas = textBox1.Text; //----->va cia pastringa
> atseit reikia panaudoto "new" ir t.t.
> Close();
> }
> }
>
> klase
> public class Class1
> {
> public string vardas { set; get; }
> }
>