private void IP2_KeyDown_1(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { IP3.Focus(); } }
private void IP4_TextChanged(object sender, EventArgs e) { //Get text from textbox string text = ((TextBox)sender).Text; //Do what ever it is you want to do to edit the text if (text.Length == 0) { IP3.Focus(); } }
/************************************************************************************************** * Change focus. * * @param ipTextBox The IP control. **************************************************************************************************/ private void ChangeFocus(TextBox ipTextBox) { switch (ipTextBox.Name) { case "IP1": IP2.Select(); break; case "IP2": IP3.Select(); break; case "IP3": IP4.Select(); break; case "IP4": ipTextBox.SelectNextControl(ActiveControl, true, true, true, true); break; } }
public IPWindow() { InitializeComponent(); IP1.SetBinding(TextBlock.TextProperty, new Binding("IP1") { Source = DataList }); IP2.SetBinding(TextBlock.TextProperty, new Binding("Port1") { Source = DataList }); IP3.SetBinding(TextBlock.TextProperty, new Binding("IP2") { Source = DataList }); IP4.SetBinding(TextBlock.TextProperty, new Binding("Port2") { Source = DataList }); IP5.SetBinding(TextBlock.TextProperty, new Binding("IP3") { Source = DataList }); IP6.SetBinding(TextBlock.TextProperty, new Binding("Port3") { Source = DataList }); IP7.SetBinding(TextBlock.TextProperty, new Binding("IP4") { Source = DataList }); IP8.SetBinding(TextBlock.TextProperty, new Binding("Port4") { Source = DataList }); }
public C2(IP1 p1, IP3 p3) { Value = 1; }