static void Go() { f1 = new FirstForm(); f2 = new SecondForm(); f1.DateSelected += (o, e) => f2.SelectedDate = e.Date.AddMonths(6); f1.Show(); f2.Show(); }
static void Go() { f1 = new FirstForm(); f2 = new SecondForm(); f1.DateSelected += new EventHandler <DateEventArgs>(f1_DateSelected); f1.Show(); f2.Show(); }
private void Load_User() { if (this.ComboBox_Reg_Login.SelectedIndex != -1) { string stLogin = this.ComboBox_Reg_Login.SelectedValue.ToString().ToLower(); string stPassword = this.Reg_Textbox_Password.Text; if (!string.IsNullOrEmpty(stLogin)) { if (!string.IsNullOrEmpty(stPassword)) { double d = 0; string stPass = null; d = Class_SQL.SelectFloat("select count(*) from bi.dbo.ABS_USER_PROFILE where active= 'Y' and DOSTUP_ABS = N'Y' and USER_NAME = N'" + stLogin + "'"); stPass = Class_SQL.SelectString("select PASSWORD from bi.dbo.ABS_USER_PROFILE where active= 'Y' and DOSTUP_ABS = N'Y' and USER_NAME = N'" + stLogin + "'"); if (stPass == Class_SQL.SelectString("select SNT.dbo.svc_md5_ngen(N'" + stPassword + "')")) { this.Hide(); FirstForm f2 = new FirstForm(stLogin); f2.Show(); } else { MessageBox.Show("Не верно указан логин или пароль.", "АБС", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Reg_Textbox_Password.Focus(); } } else { MessageBox.Show("Поле Пароль не заполнено.", "АБС", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Reg_Textbox_Password.Focus(); } } else { MessageBox.Show("Поле Логин не заполнено.", "АБС", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Reg_Textbox_Password.Focus(); } } else { MessageBox.Show("Поле Логин не заполнено.", "АБС", MessageBoxButtons.OK, MessageBoxIcon.Error); this.ComboBox_Reg_Login.Focus(); } }
static void Main(string[] args) { string title = ""; string name = ""; for (int i = 0; i < args.Length; i++) { title = args[0]; name = args[1]; } Form form = new FirstForm(title, name); Application.Run(form); }
static void Main(string[] args) { // get title and name from command lines string title = ""; string name = ""; for (int i = 0; i < args.Length; i++) { title = args[0]; // get first argument and store it title name = args[1]; // get second argument and store it in name } // instanciate the form class with the two arguments title and name. Form form = new FirstForm(title, name); // run application Application.Run(form); }
public SecondaryForm(FirstForm form) : this() { this.firstForm = form; firstForm.Timer.Tick += new EventHandler(Timer_Tick); }
public SecondForm(FirstForm form1) : this() { this.form1 = form1; }
public SecondaryForm(FirstForm form) : this() { this.firstForm = form; // optional firstForm.SomeEvent += new EventHandler(SecondForm_SomeMethod); }
private void btnShowFirst_Click(object sender, EventArgs e) { firstForm = new FirstForm(_semantic.GetFirstList()); firstForm.ShowDialog(); }
public SecondForm(FirstForm firstForm) { // do something with firstForm.MyListBox }
private void button8_Click(object sender, EventArgs e) { var firstQuery = new FirstForm(); firstQuery.ShowDialog(); }
public static Shapes chooseFormToGenerateElements() { while (true) { Console.WriteLine("Please, choose form to generate elements(from 1 to 14) or \"500\" to finish program: "); int numberOfForm = Int32.Parse(Console.ReadLine()); UserInterfaceHelpers.checkIfWantToExitTheProgram(numberOfForm); if (UserInterfaceHelpers.checkTheCorrectInputNumberOfForm(numberOfForm, Config.NumberOfForms)) { switch (numberOfForm) { case (int)NumberOfForms.FirstForm: { FirstForm form = new FirstForm(); return(form); } case (int)NumberOfForms.SecondForm: { SecondForm form = new SecondForm(); return(form); } case (int)NumberOfForms.ThirdForm: { ThirdForm form = new ThirdForm(); return(form); } case (int)NumberOfForms.FourthForm: { FourthForm form = new FourthForm(); return(form); } case (int)NumberOfForms.FifthForm: { FifthForm form = new FifthForm(); return(form); } case (int)NumberOfForms.SixthForm: { SixthForm form = new SixthForm(); return(form); } case (int)NumberOfForms.SeventhForm: { SeventhForm form = new SeventhForm(); return(form); } case (int)NumberOfForms.EighthForm: { EighthForm form = new EighthForm(); return(form); } case (int)NumberOfForms.NinthForm: { NinthForm form = new NinthForm(); return(form); } case (int)NumberOfForms.TenthForm: { TenthForm form = new TenthForm(); return(form); } case (int)NumberOfForms.EleventhForm: { EleventhForm form = new EleventhForm(); return(form); } case (int)NumberOfForms.TwelfthForm: { TwelfthForm form = new TwelfthForm(); return(form); } case (int)NumberOfForms.ThirteenthForm: { ThirteenthForm form = new ThirteenthForm(); return(form); } case (int)NumberOfForms.FourteenthForm: { FourteenthForm form = new FourteenthForm(); return(form); } } } else { continue;; } } }