muratboy31 Posted December 8, 2015 Share Posted December 8, 2015 Merhaba arkadaşlar, 3 adet form var projede, istediğim form 3 te butana tıklandığında form 1 deki değer true olsun ama bir türlü olmuyor nedense ! Form 3 : private void buttonX1_Click(object sender, EventArgs e) { Form1 Main = new Form1(); Main.LoginCheck = true; } Form 1 : public bool LoginCheck { get; set; } private void metroShell1_SettingsButtonClick(object sender, EventArgs e) { if (LoginCheck == true) { Form4 Panel = new Form4(); Point location = new Point(this.Location.X - (this.Width - 20), this.Location.Y + this.Height / 2 - eMail.Height); Panel.Location = location; Panel.Show(); } else { Form3 Login = new Form3(); Point location = new Point(this.Location.X - (this.Width - 20), this.Location.Y + this.Height / 2 - eMail.Height); Login.Location = location; Login.ShowDialog(); } } private void Form1_Load(object sender, EventArgs e) { LoginCheck = false; } Quote Link to comment Share on other sites More sharing options...
KintaRo Posted December 8, 2015 Share Posted December 8, 2015 public static bool LoginCheck { get; set; } static olarak değiştiriseniz olacaktır. Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted December 8, 2015 Author Share Posted December 8, 2015 ama ozaman da diğer formdan erişim sağlayamıyorum değişkene ; Error 1 Member 'Form1.LoginCheck.get' cannot be accessed with an instance reference; qualify it with a type name instead Form3.cs 28 13 Quote Link to comment Share on other sites More sharing options...
KintaRo Posted December 8, 2015 Share Posted December 8, 2015 https://yadi.sk/d/cyD1Tb6wm4v4T Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted December 8, 2015 Author Share Posted December 8, 2015 anladım, ben form1 yeniden oluşturuyorum diye sorun çıkıyormuş; çok teşekkürler Kintaro 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.