private void Simulasyon_Click(object sender, RoutedEventArgs e) { simulasyon sm = new simulasyon(); if (hak == 1) { if (MessageBox.Show("Simülasyona bir kere giriş yapabilirsiniz.", "Simülasyon", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { sm.Show(); sm.lbl_id.Content = lbl_id.Content; hak--; } } else { MessageBox.Show("Buraya artık giremezsiniz"); simulasyon.IsEnabled = false; } //else if (hak < 3 && hak > 0) //{ // MessageBox.Show("Kalan giriş hakkı: " + hak); // sm.Show(); // sm.lbl_id.Content = lbl_id.Content; // sm.s1.IsEnabled = false; // sm.s2.IsEnabled = false; //} //else if (hak == 0 || hak < 0) //{ // MessageBox.Show("buraya giriş hakkınız kalmadı"); //} //this.Close(); }
private void Nou_simulasyon_Click(object sender, RoutedEventArgs e) { simulasyon s_ = new simulasyon(); s_.Show(); Random rnd = new Random(); int a = (Convert.ToInt32(rnd.Next(10000, 99999))); s_.lbl_id.Content = a.ToString(); //this.Close(); }