Form1’deki Listbox’ta Seçili Kişiye Form2’de Merhaba Yaz C#

Form1’deki Listbox’ta Seçili Kişiye Form2’de Merhaba Yaz C#


Form1’e yazılacaklar :

[code lang=”csharp”]

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;//www.gorselprogramlama.com

namespace listbox_cift_tikla_mrb_yaz

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

public static string ad;

private void listBox1_DoubleClick(object sender, EventArgs e)

{

ad = listBox1.Text;

Form2 frm2 = new Form2(); //www.gorselprogramlama.com

frm2.Show();

}

//www.gorselprogramlama.com

}

}

[/code]

Form2’ye yazılacaklar :

[code lang=”csharp”]

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;//www.gorselprogramlama.com

using System.Windows.Forms;

namespace listbox_cift_tikla_mrb_yaz

{

public partial class Form2 : Form

{

public Form2()

{

InitializeComponent();

}//www.gorselprogramlama.com

private void Form2_Load(object sender, EventArgs e)

{

label1.Text = "Merhaba " + Form1.ad.ToString();

}//www.gorselprogramlama.com

}

}

[/code]

Projeyi İNDİR

Yorumlar 1

  • InitializeComponent();

    label1.Text = “Merhaba ” + Form1.ad.ToString();
    ( The name ‘InitializeComponent’ does not exist in the current context. ) hata mesajı…
    ( The name ‘label1’ does not exist in the current context. ) hata mesajı…

    bu mesajları alıyorum sebebi ne olabilir. hata mı yapıorum dedim burdan copy paste yaptım yine aynı… 🙁

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir