ihsan43 Posted March 1, 2015 Share Posted March 1, 2015 selam arkadaşlar c# da değişkenin yerel ve global kullanımı ile ilgili bi program yapıyorum form 1 in class kısmında sayi değişkenini tanımladım ancak aynı değişkeni form 2 ye gidince de kullanmak istiyorum bunu nasıl yaparım. -teşekkürler Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 1, 2015 Editor Share Posted March 1, 2015 static olarak tanımlamanız lazım direk erişecekseniz. yada Form1 frm = new Form1(); frm.Degiskenismi şeklindede erişebilirsiniz. Veya Application.OpenForms["Form1"].degisken ismi gibide erişebilirisniz şayet form1 açıksa Quote Link to comment Share on other sites More sharing options...
Editor MOTUN Posted March 1, 2015 Editor Share Posted March 1, 2015 Bu konu "Yazılım" forumundan "C#" forumuna taşınmıştır. Quote Link to comment Share on other sites More sharing options...
ihsan43 Posted March 1, 2015 Author Share Posted March 1, 2015 (edited) benım kodlar su sekilde buda form 2 form 1 de tanımladıgım sayi değişkeni programın genelinde çalışssın istiyorum, sizin dediğiniz gibi yapamadım Edited March 1, 2015 by ihsan43 Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 1, 2015 Editor Share Posted March 1, 2015 Tamam Form1.sayi diyerek erişebilirsin. 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.