/// <summary> /// Remove all the pictures from list /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ResetPictures_Click(object sender, RoutedEventArgs e) { ClearForm(); ClearFaces(); SetStatus(""); NameTextBox.Focus(); }
/// <summary> /// 修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ModItem_OnClick(object sender, RoutedEventArgs e) { if (ModButton.Content.ToString() == "修改") { if (IDTextBox.Text == "") { return; } NameTextBox.IsReadOnly = false; PasswordTextBox.IsReadOnly = false; LevelComboBox.IsEnabled = true; NameTextBox.Focus(); ModButton.Content = "完成"; } else { if (IDTextBox.Text == "") { ModButton.Content = "修改"; return; } NameTextBox.IsReadOnly = true; PasswordTextBox.IsReadOnly = true; LevelComboBox.IsEnabled = false; _users[int.Parse(IDTextBox.Text) - 1].Name = NameTextBox.Text; _users[int.Parse(IDTextBox.Text) - 1].Password = PasswordTextBox.Text; _users[int.Parse(IDTextBox.Text) - 1].Level = LevelComboBox.Text; UpdateGrid(_users[int.Parse(IDTextBox.Text) - 1]); ModButton.Content = "修改"; } }
private void SiteDetailsDialogControl_Loaded(object sender, RoutedEventArgs e) { // Initialize site name textbox if (BuilderApplication.Instance.CurrentSite != null && !string.IsNullOrEmpty(BuilderApplication.Instance.CurrentSite.Name)) { NameTextBox.Text = BuilderApplication.Instance.CurrentSite.Name; } else if (ViewerApplicationControl.Instance != null && ViewerApplicationControl.Instance.ViewerApplication != null && !string.IsNullOrEmpty(ViewerApplicationControl.Instance.ViewerApplication.TitleText)) { NameTextBox.Text = ViewerApplicationControl.Instance.ViewerApplication.TitleText; } // Initialize description textbox if (BuilderApplication.Instance.CurrentSite != null && !string.IsNullOrEmpty(BuilderApplication.Instance.CurrentSite.Description)) { DescriptionTextBox.Text = BuilderApplication.Instance.CurrentSite.Description; } else { DescriptionTextBox.Text = ""; } NameTextBox.Focus(); NameTextBox.SelectAll(); }
public ChartPropertiesForm(Node node) { InitializeComponent(); Statics.AddImageToButtonWithText(SaveButton, "checkmark48.png"); Statics.AddImageToButtonWithText(AddButton, "Tango Icons\\list-add.png"); Statics.AddImageToButtonWithText(UpButton, "Tango Icons\\go-up.png"); Statics.AddImageToButtonWithText(RemoveButton, "Tango Icons\\edit-delete.png"); Statics.AddImageToButtonWithText(EditButton, "Tango Icons\\view-refresh.png"); this.node = node; this.Background = Statics.FormBackground; dataTable = new DataTable(); dataTable.Columns.Add("Name"); dataTable.Columns.Add("Value"); int i; for (i = 0; i < node.Properties.Count; i += 2) { DataRow row = dataTable.NewRow(); row["Name"] = node.Properties[i]; row["Value"] = node.Properties[i + 1].ToString(); dataTable.Rows.Add(row); } listView1.DataContext = dataTable; NameTextBox.Focus(); }
private void ClearButton_Click(object sender, EventArgs e) { NameTextBox.Text = ""; InputTextBox1.Text = ""; InputTextBox2.Text = ""; NameTextBox.Focus(); }
private bool IsFormValid() { if (NameTextBox.Text.Trim() == string.Empty) { Messages.ShowErrorMessage("Name is required"); NameTextBox.Clear(); NameTextBox.Focus(); return(false); } if (EmailTextBox.Text.Trim() == string.Empty) { Messages.ShowErrorMessage("Email is required"); EmailTextBox.Clear(); EmailTextBox.Focus(); return(false); } if (TelephoneTextBox.Text.Trim() == string.Empty) { Messages.ShowErrorMessage("Telephone is required"); TelephoneTextBox.Clear(); TelephoneTextBox.Focus(); return(false); } return(true); }
public Login() { InitializeComponent(); _vm = new ViewModels.LoginViewModel(); this.DataContext = _vm; NameTextBox.Text = "shuayb"; PasswordBox.Password = "******"; NameTextBox.Focus(); //using (var db = new AlphaElectricEntitiesDB()) //{ // //Adding New User // AlphaElectric_DataAccessLayer.Login newUser = new AlphaElectric_DataAccessLayer.Login() // { // Username = "******", // Name = "Shuayb Ashraf", // Password = Hashing.HashPassword("12345") // }; // db.Logins.Add(newUser); // db.SaveChanges(); //} }
public PersonPage(Logic l, Patient p = null) { InitializeComponent(); EnableTextBoxes(false); AppLogic = l; if (p == null) { p = new Patient(); AppointmentsGrid.Visibility = Visibility.Hidden; PatientDataStackPanel.Visibility = Visibility.Hidden; NewPatientStackPanel.Visibility = Visibility.Visible; i.Visibility = Visibility.Visible; EnableTextBoxes(true); PeselTextBox.IsEnabled = true; NameTextBox.Focus(); } else if (!DEBUG) { try { list = new ObservableCollection <Visit>(AppLogic.ShowPatientVisits(p)); VisitsList.ItemsSource = list; } catch (Exception ex) { MessageBoxes.ShowUnknownError(ex); } } CurrentPatient = p; }
private void SaveButton_Click(object sender, EventArgs e) { SqlCeConnection Connection = DataBaseConnection.Instance.Connection; try { if (NameTextBox.Text == "") { MessageBox.Show("Unesite ime para!"); } else if (SportComboBox.Text == "") { MessageBox.Show("Uzaberite vrstu sporta!"); } else { SqlCeCommand command = new SqlCeCommand("INSERT INTO Doubles (Name, Sports_Id) VALUES" + " ('" + NameTextBox.Text + "', '" + SportComboBox.Text + "'); ", Connection); command.ExecuteNonQuery(); MessageBox.Show("Unos je uspio!"); NameTextBox.Clear(); NameTextBox.Focus(); } } catch (Exception ee) { MessageBox.Show("Unos nije uspio! \r Greska: " + ee.Message); return; } }
private void EditCheckBox_CheckedChanged(object sender, EventArgs e) { var state = EditCheckBox.Checked; AddListButton.Enabled = !state; EditCheckBox.Enabled = !state; DeleteListButton.Enabled = !state; NameTextBox.ReadOnly = !state; PublicRadioButton.Enabled = state; PrivateRadioButton.Enabled = state; DescriptionText.ReadOnly = !state; ListsList.Enabled = !state; OKEditButton.Enabled = state; CancelEditButton.Enabled = state; EditCheckBox.AutoCheck = !state; MemberGroup.Enabled = !state; UserGroup.Enabled = !state; CloseButton.Enabled = !state; UsernameTextBox.TabStop = !state; MemberCountTextBox.TabStop = !state; SubscriberCountTextBox.TabStop = !state; if (state) { NameTextBox.Focus(); } }
private void RegisterButtonRegistrationWindow_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(EmailTextBox.Text)) { MessageBox.Show("Email is not entered!"); EmailTextBox.Focus(); } else if (!_repo.IsEmailUnique(EmailTextBox.Text)) { MessageBox.Show("User with such email already exists. \nEmail should be unique!"); return; } else if (string.IsNullOrWhiteSpace(NameTextBox.Text)) { MessageBox.Show("Full name is not entered!"); NameTextBox.Focus(); } else if (string.IsNullOrWhiteSpace(PasswordTextBox.Password)) { MessageBox.Show("Password is not entered"); PasswordTextBox.Focus(); } else { _repo.CreateNewUser(NameTextBox.Text, EmailTextBox.Text, PasswordTextBox.Password); DialogResult = true; } }
private void AddButton_Click(object sender, EventArgs e) { string ProductName = NameTextBox.Text; string ProductCategory = CategoryComboBox.Text; string ProductWeight = WeightTextBox.Text; string ProductCost = CostTextBox.Text; string ProductExpire = ExpireTextBox.Text; Product Good = new Product(ProductName, ProductWeight, ProductCost, ProductExpire, ProductCategory); StoreSystem.AddToSystem(Good); // All products are stored in array StoreSystem.List. StockProductTextBox.Text = Convert.ToString(Product.ProdudctCount); MeatCatTextBox.Text = Convert.ToString(Product.MeatCategoryID); SweetCatTextBox.Text = Convert.ToString(Product.SweetCategoryID); VegetableCatTextBox.Text = Convert.ToString(Product.VegerableCategoryID); AlertLabel.Text = Good.alert; NameTextBox.Text = ""; CategoryComboBox.Text = ""; WeightTextBox.Text = ""; CostTextBox.Text = ""; ExpireTextBox.Text = ""; NameTextBox.Focus(); }
private void NameChangeButton_Click(object sender, RoutedEventArgs e) { if (!ChangingName) { NameTextBox.Text = SettingsData.Name; NameTextBox.Visibility = Visibility.Visible; NameTextBox.IsHitTestVisible = true; NameTextBox.SelectAll(); NameTextBox.Focus(); NameTextBox.CaretIndex = NameTextBox.Text.Length; } else { if (nameValid) { SettingsData.Name = NameTextBox.Text; } NameTextBox.Visibility = Visibility.Hidden; NameTextBox.IsHitTestVisible = false; NameTextBox.Text = ""; NameChangeButton.Content = "Change name"; } }
private void SubjectTextBoxReply_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == Key.Enter) { NameTextBox.Focus(); } }
public RenameDictionaryWindow() { InitializeComponent(); MainGrid.DataContext = this; NameTextBox.Focus(); }
private void AddButton_Click(object sender, EventArgs e) { if (NameTextBox.Text == "") { MessageBox.Show("Employee name not entered."); NameTextBox.Focus(); return; } int IDNumber; try { IDNumber = int.Parse(IDTextBox.Text); } catch { MessageBox.Show("Invalid Employee ID."); IDTextBox.Focus(); return; } myEmployee.NewEmployee(NameTextBox.Text, IDNumber, DepartmentTextBox.Text, PositionTextBox.Text); NameTextBox.Clear(); IDTextBox.Clear(); DepartmentTextBox.Clear(); PositionTextBox.Clear(); ListBox.Items.Add("Employee: " + IDNumber + " added!"); NameTextBox.Focus(); }
// focus when criterion is added private void NameTextBoxTextChanged(object sender, TextChangedEventArgs e) { if (((TextBox)sender).Text == "") { NameTextBox.Focus(); } }
public Task <bool> IsValid() { if (DataContext is not YandexPreset preset) { return(Task.FromResult(false)); } if (string.IsNullOrWhiteSpace(preset.Title)) { StatusBand.Warning(LocalizationHelper.Get("S.Options.Upload.Preset.Warning.Title")); NameTextBox.Focus(); return(Task.FromResult(false)); } if (UserSettings.All.UploadPresets.OfType <UploadPreset>().Any(a => a.Title != _originalTitle && a.Title == preset.Title.Trim())) { StatusBand.Warning(LocalizationHelper.Get("S.Options.Upload.Preset.Warning.Repeated")); NameTextBox.Focus(); return(Task.FromResult(false)); } if (string.IsNullOrWhiteSpace(preset.OAuthToken)) { StatusBand.Warning(LocalizationHelper.Get("S.Options.Upload.Preset.Warning.Token")); TokenTextBox.Focus(); return(Task.FromResult(false)); } return(Task.FromResult(true)); }
public LocationSettingWindow(string name = "") { InitializeComponent(); NameTextBox.Text = name; if (name != string.Empty) { this.name = name; Location location; location = WorkingSets.local.getLocation(name); if (!WorkingSets.local.LocalSQLClient.Connected) { ErrorReporter.ErrorReport(30002, "位置管理器", WorkingSets.local.LocalSQLClient.ErrorText); } if (location.id > -1) { TitleTextBlock.Text = "修改位置"; Changingconfirm = true; originName = name; CompanyTextBox.Text = location.company; AddressTextBox.Text = location.address; OperatorTextBox.Text = location.operatorName; textChanged = false; } else { TitleTextBlock.Text = "新位置"; } } else { TitleTextBlock.Text = "新位置"; } NameTextBox.Focus(); }
private void UpdateFormFieldsFromRepositoryView(int itemIndex) { var item = TeaRepositoryView.Items[itemIndex]; if (item is IEntry <TeaTimerDefinition> ) { var entry = (IEntry <TeaTimerDefinition>)item; NameTextBox.Text = entry.Value.Name; MinuteUpDown.Value = entry.Value.Time.Minute; SecondUpDown.Value = entry.Value.Time.Second; TeaEditGroup.Text = entry.Value.Name; CancelBtn.Enabled = true; SaveBtn.Text = "Save"; SaveBtn.Enabled = !_setup.Handles.ContainsKey(entry); TeaRepositoryView.ContextMenu = _contextMenu; } else { NameTextBox.Text = string.Empty; MinuteUpDown.Value = 4; SecondUpDown.Value = 0; TeaEditGroup.Text = item.ToString(); CancelBtn.Enabled = false; SaveBtn.Enabled = true; SaveBtn.Text = "Create"; } NameTextBox.Focus(); }
private void CommandBinding_SaveAsVariant_Executed(object sender, ExecutedRoutedEventArgs e) { var diagnosis = GetCurrent(); if (diagnosis == null) { return; } var diagnosisGroup = diagnosis.DiagnosisGroup; var name = TextBoxController.TextGet(NameTextBox); if (string.IsNullOrEmpty(name) || DiagnosisCollection.Any(d => d.Name == TextBoxController.TextGet(NameTextBox))) { TextBoxController.AppendText("Please enter variant name", NameTextBox); return; } var text = PreviewBox.Text; if (string.IsNullOrEmpty(text)) { PreviewBox.Text = "Please enter report text"; return; } NameTextBox.Focus(); NameTextBox.SelectAll(); DiagnosisCollection.Add(new Diagnosis(name, text, diagnosisGroup)); Repository.SaveCollection(DiagnosisCollection); }
private void Button_Click(object sender, RoutedEventArgs e) { //启动线程登录 //验证输入 if (string.IsNullOrEmpty(NameTextBox.Text)) { SetInformationString("请输入用户名"); NameTextBox.Focus(); return; } if (string.IsNullOrEmpty(PasswordBox.Password)) { SetInformationString("请输入密码"); PasswordBox.Focus(); return; } SetInformationString("正在验证维护状态..."); UISettings(false); UserName = NameTextBox.Text; UserPassword = PasswordBox.Password; IsChecked = (bool)Remember.IsChecked; ThreadAccountLogin = new Thread(ThreadCheckAccount); ThreadAccountLogin.IsBackground = true; ThreadAccountLogin.Start(); }
private bool ValidateInputs() { if (NameTextBox.Text == String.Empty) { Deployment.Current.Dispatcher.BeginInvoke(() => Globals.DisplayToast(CustomMessage.InvalidUserNameWhileRegistering, "basicWrap", "Oops!")); NameTextBox.Focus(); return(false); } if (MobileNumberTextBox.Text == String.Empty) { Deployment.Current.Dispatcher.BeginInvoke(() => Globals.DisplayToast(CustomMessage.InvalidMobileNumberWhileRegistering, "basicWrap", "Oops!")); MobileNumberTextBox.Focus(); return(false); } if (Config.IsEnterpriseBuild) { if (string.IsNullOrWhiteSpace(HiddenEmailSecurityCodeTextBox.Text) || HiddenEmailSecurityCodeTextBox.Text.Length > 5) { Deployment.Current.Dispatcher.BeginInvoke(() => Globals.DisplayToast(CustomMessage.InvalidEmailSecurityCodeWhileRegistering, "basicWrap", "Oops!")); EmailSecurityCodeTextBox.Focus(); return(false); } } if (string.IsNullOrWhiteSpace(HiddenSecurityCodeTextBox.Text) || HiddenSecurityCodeTextBox.Text.Length > 5) { Deployment.Current.Dispatcher.BeginInvoke(() => Globals.DisplayToast(CustomMessage.InvalidSecurityCodeWhileRegistering, "basicWrap", "Oops!")); SecurityCodeTextBox.Focus(); return(false); } //TODO: If there is alerady profile exisits, return error message "Profile Already exisits" return(true); }
private void NewButton_Click(object sender, RoutedEventArgs e) { Settings.LogButtonClicked(sender as Button); ClearInputs(); NameTextBox.Focus(); _IsInNewMode = true; }
// Create new customer private void CreateNewCustomer_Click(object sender, RoutedEventArgs e) { SetDefaultSettings(); MainPageLabel.Content = "CREATE NEW CUSTOMER:"; foreach (Control c in userControlsList) { c.Visibility = Visibility.Visible; } foreach (Control c in addressControlsList) { c.Visibility = Visibility.Visible; } OfficialSubTypeComboBox.Visibility = Visibility.Hidden; CustomerSubTypeComboBox.Visibility = Visibility.Visible; CustomerSubTypeComboBox.IsEnabled = false; StornoButton.Visibility = Visibility.Visible; CreateCustomerButton.Visibility = Visibility.Visible; ValidTextBox.Text = "Yes"; ValidTextBox.IsEnabled = false; UserTypeComboBox.Text = "Customer"; UserTypeComboBox.IsEnabled = false; CountryTextBox.Text = "CZE"; CountryTextBox.IsEnabled = false; LoginLabel.Content = "SSN"; NameTextBox.Focus(); }
private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Tab) { if (NameTextBox.IsFocused) { DateTextBox.Focus(); } else if (DateTextBox.IsFocused) { PublicDocumentRadioButton.Focus(); } else if (PublicDocumentRadioButton.IsFocused) { HiddenDocumentRadioButton.Focus(); } else if (HiddenDocumentRadioButton.IsFocused) { ContentTextBox.Focus(); } else { NameTextBox.Focus(); } e.Handled = true; } }
private void OnLoaded(object sender, RoutedEventArgs e) { Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() => { NameTextBox.Focus(); NameTextBox.SelectAll(); })); }
private void ImgurPanel_Loaded(object sender, RoutedEventArgs e) { _originalTitle = NameTextBox.Text.Trim(); NameTextBox.Focus(); UpdateAlbumList(true); }
private void NameTextBlock_DoubleTapped(object sender, Windows.UI.Xaml.Input.DoubleTappedRoutedEventArgs e) { NameTextBox.Text = NameTextBlock.Text; NameTextBox.SelectAll(); NameTextBlock.Visibility = Visibility.Collapsed; NameTextBox.Visibility = Visibility.Visible; NameTextBox.Focus(FocusState.Programmatic); }
protected override async Task OnFirstLoad() { if (FolderId == null) { NameTextBox.Focus(FocusState.Programmatic); } await VM.Load(FolderId); }