korasoglu Posted July 13, 2015 Share Posted July 13, 2015 Arkaşlar class oluşturup veri gönderip alabiliyorum burada sorun yok. Fakat class dan formdaki nesnele ulaşamıyorum. Diyelimki gönderdiğim veriyi kullandı o veriye göre combo, listbox vb işlem yaptırabilirmiyim yani dönen degeri yazdırım butona tıklama vs olabilirmi. ListBox public yaptım class da ise nesneye ulaşdım ama ekleme yapmadı Form1 frm = new Form1(); frm.listBox1.Items.Add(name); Quote Link to comment Share on other sites More sharing options...
KintaRo Posted July 13, 2015 Share Posted July 13, 2015 TestClass.cs: using System.Windows.Forms; namespace testler { class TestClass { public static void Deneme(ListBox lstbx) { lstbx.Visible = false; } } } class'taki metodumuza gönderilecek değeri ListBox cinsinden ayarladık. daha sonra Form1'den şu komutu gönderdiğimizde Form1'deki listbox1'i görünmez yapacaktır: TestClass.Deneme(listBox1); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.