Пример #1
0
 private void resetFormToolStripMenuItem_Click(object sender, EventArgs e)
 {
     NameTextbox.Clear();
     EmailTextBox.Clear();
     MobileTextBox.Clear();
     AddressTextBox.Clear();
 }
Пример #2
0
 private void ClearTextboxes()
 {
     NameTextbox.Clear();
     MailTextbox.Clear();
     AdminMailLabel.Content = $"Mail: ";
     UserMailLabel.Content  = $"Mail: ";
 }
Пример #3
0
        //Selected index changed on the ListView gets the selected Client and sets Textboxes.
        public void ClientsLView_SelectedIndexChanged(object sender, EventArgs e)
        {
            lock (serverLocker)
            {
                if (ServerWorking)
                {
                    ListView list          = (ListView)sender;
                    int      selectedIndex = 0;
                    foreach (int i in list.SelectedIndices)
                    {
                        selectedIndex = i;
                    }
                    ClientHandler c = (ClientHandler)list.Items[selectedIndex].Tag;
                    SelectedClient = c;


                    IpTextbox.BeginInvoke(txtDelegate,
                                          SelectedClient.ClientIep.Address.ToString(),
                                          IpTextbox, false);
                    PortTextbox.BeginInvoke(txtDelegate,
                                            SelectedClient.ClientIep.Port.ToString(),
                                            PortTextbox, false);
                    NameTextbox.BeginInvoke(txtDelegate,
                                            SelectedClient.Name,
                                            NameTextbox, false);
                }
            }
        }
Пример #4
0
 /// <summary>
 /// Метод проверки ввода имени
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void NameTextbox_TextChanged(object sender, EventArgs ex)
 {
     UpperFirstSimbol(sender);
     try
     {
         _contact.Name         = NameTextbox.Text;
         NameTextbox.BackColor = Color.White;
         errorProvider.SetError(NameTextbox, String.Empty);
         _checkNameResult = true;
     }
     catch (ArgumentNullException e)
     {
         errorProvider.SetError(NameTextbox, e.Message);
         NameTextbox.Focus();
         NameTextbox.BackColor = Color.LightSalmon;
         _checkNameResult      = false;
     }
     catch (ArgumentException e)
     {
         errorProvider.SetError(NameTextbox, e.Message);
         NameTextbox.Focus();
         NameTextbox.BackColor = Color.LightSalmon;
         _checkNameResult      = false;
     }
 }
 public ArrayChallengePageObject PopulateAnswerForm(AnswerForm answerForm)
 {
     FirstAnswerTextbox.SendKeys(answerForm.FirstAnswer);
     SecondAnswerTextbox.SendKeys(answerForm.SecondAnswer);
     ThirdAnswerTextbox.SendKeys(answerForm.ThirdAnswer);
     NameTextbox.SendKeys(answerForm.Name);
     return(this);
 }
Пример #6
0
 private void SnapPerson()
 {
     //reset persons
     NameTextbox.Clear();
     OccupationTextbox.Clear();
     BirthdayPicker.Value            = DateTime.Now;
     ResidenceCombobox.SelectedIndex = -1;
 }
 private void Add_New_Button_Click(object sender, RoutedEventArgs e)
 {
     MealPlannerDatabaseGrid.IsEnabled = false;
     NameTextbox.Clear();
     createdNewRow                     = true;
     NameTextbox.IsEnabled             = true;
     AddNewButton.IsEnabled            = false;
     RequiredFieldIcon_Name.Visibility = Visibility.Visible;
     SaveDatabaseButton.IsEnabled      = false;
 }
 public void deSelect()
 {
     MealPlannerDatabaseGrid.SelectedItem = null;
     NameTextbox.IsEnabled = false;
     NameTextbox.Clear();
     RequiredFieldIcon_Name.Visibility = Visibility.Hidden;
     SaveDatabaseButton.IsEnabled      = true;
     AddNewButton.IsEnabled            = true;
     DeleteRowButton.IsEnabled         = true;
     MealPlannerDatabaseGrid.IsEnabled = true;
 }
Пример #9
0
 private void NameTextbox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Modifiers == Keys.Control)
     {
         if (e.KeyCode == Keys.A)
         {
             NameTextbox.SelectAll();
             e.SuppressKeyPress = true;
             e.Handled          = true;
         }
     }
 }
Пример #10
0
 public void deSelect()
 {
     MealSelectorDatabaseGrid.SelectedItem = null;
     MealSelectorDatabaseGrid.IsEnabled    = true;
     NameTextbox.IsEnabled         = false;
     FoodTypeTextbox.IsEnabled     = false;
     BuildingTypeTextbox.IsEnabled = false;
     NameTextbox.Clear();
     BuildingTypeTextbox.SelectedIndex         = -1;
     FoodTypeTextbox.SelectedIndex             = -1;
     RequiredFieldIcon_Name.Visibility         = Visibility.Hidden;
     RequiredFieldIcon_BuildingType.Visibility = Visibility.Hidden;
     RequiredFieldIcon_FoodType.Visibility     = Visibility.Hidden;
     SaveDatabaseButton.IsEnabled = true;
     AddNewButton.IsEnabled       = true;
     DeleteRowButton.IsEnabled    = true;
 }
Пример #11
0
        public MainWindow()
        {
            rand = new Random();

            clientWork                 = new Client();
            clientWork.Terminate      += Terminated;
            clientWork.StartGame      += StartGame;
            clientWork.UpdateTime     += UpdateTime;
            clientWork.UpdateScores   += UpdateScore;
            clientWork.UpdateWordList += UpdateListOfWords;
            clientWork.EndGame        += EndGame;

            InitializeComponent();
            grid = new List <TextBox>()
            {
                Board1, Board2, Board3, Board4, Board5, Board6
                , Board7, Board8, Board9, Board10, Board11, Board12, Board13, Board14, Board15
                , Board16
            };
            gridGreen = new List <TextBox>()
            {
                Board17, Board18, Board19, Board20, Board21, Board22
                , Board23, Board24, Board25, Board26, Board27, Board28, Board29, Board30, Board31
                , Board32
            };
            CancelButton.Visibility = Visibility.Hidden;

            int random = rand.Next(0, 9);

            Dispatcher.Invoke(new Action(() => QuoteTextbox.Content   = quotes[random]));
            Dispatcher.Invoke(new Action(() => QuotersTextbox.Content = quoters[random]));

            //Set focus to name text box.
            NameTextbox.Focus();

            //Hide tab controls
            Style s = new Style();

            s.Setters.Add(new Setter(UIElement.VisibilityProperty, Visibility.Collapsed));
            tabControl.ItemContainerStyle = s;
            System.Diagnostics.Debug.WriteLine("Sending " + WordTextbox.Text);
        }
Пример #12
0
        //Refreshes ListView with all conected clients and refreshes selected client info.
        public void RefreshInfo()
        {
            lock (serverLocker)
            {
                if (ServerWorking)
                {
                    ClientsListView.BeginInvoke(lstClearDelegate, ClientsListView);
                    for (int i = 0; i < connectedClients.Count; i++)
                    {
                        ClientsListView.BeginInvoke(lstAddDelegate, connectedClients[i], i, 0, ClientsListView);
                    }

                    if (SelectedClient != null)
                    {
                        IpTextbox.BeginInvoke(txtDelegate,
                                              SelectedClient.ClientIep.Address.ToString(),
                                              IpTextbox, false);
                        PortTextbox.BeginInvoke(txtDelegate,
                                                SelectedClient.ClientIep.Port.ToString(),
                                                PortTextbox, false);
                        NameTextbox.BeginInvoke(txtDelegate,
                                                SelectedClient.Name,
                                                NameTextbox, false);
                    }
                    else
                    {
                        IpTextbox.BeginInvoke(txtDelegate,
                                              "-",
                                              IpTextbox, false);
                        PortTextbox.BeginInvoke(txtDelegate,
                                                "-",
                                                PortTextbox, false);
                        NameTextbox.BeginInvoke(txtDelegate,
                                                "-",
                                                NameTextbox, false);
                    }
                }
            }
        }
Пример #13
0
        private void SaveAndAddAnotherContactButton_Click(object sender, EventArgs e)
        {
            try
            {
                XMLHelper helper = new XMLHelper();

                Mail_Client.Models.Contact NewContact = new Models.Contact();
                NewContact.ID    = helper.LastElementUniqueID(_location + "Contacts.xml", "Contact") + 1;
                NewContact.Name  = NameTextbox.Text;
                NewContact.Email = EmailIDTextbox.Text;

                contactManager.Add(NewContact);

                MessageBox.Show("New Contact: " + NewContact.Name + " Added Successfully");

                NameTextbox.Clear();
                EmailIDTextbox.Clear();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Some Unexpected error has occured while adding new contact. Please try again after sometime.");
            }
        }
Пример #14
0
        private void SetNextFile()
        {
            currentFile++;
            hasReplaced = false;

            if (filenamesLoaded.Length > currentFile)
            {
                var nextFile = filenamesLoaded[currentFile];

                // decide if auto-skip.
                if (AutoSkipShortNamesCheckbox.Checked && nextFile.Length < 12)
                {
                    SetNextFile();
                    return;
                }

                // load preview image without locking file.
                using (var bmpTemp = new Bitmap(nextFile))
                {
                    PreviewPictureBox.Image = new Bitmap(bmpTemp);
                    PreviewPictureBox.Update();
                }

                // prompt to rename.
                NameTextbox.Text = Path.GetFileNameWithoutExtension(nextFile);
                NameTextbox.Focus();
                NameTextbox.SelectAll();
            }
            else
            {
                MessageBox.Show("All files checked.");

                NameTextbox.Text     = string.Empty;
                RenameButton.Enabled = false;
            }
        }
Пример #15
0
 private void ClearForm()
 {
     NameTextbox.Clear();
     AgeTextbox.Clear();
     SubmitButton.Enabled = false;
 }
Пример #16
0
 private void Clear()
 {
     NameTextbox.Clear();
     AgeTextbox.Clear();
     BtnSubmit.Enabled = false;
 }
Пример #17
0
 private void ClearForm()
 {
     NameTextbox.Clear();
     AgeTextbox.Clear();
 }
Пример #18
0
 private void NewApplication_Load(object sender, EventArgs e)
 {
     developerTableAdapter.Fill(researchDatabaseDataSet.Developer);
     NameTextbox.Focus();
 }
Пример #19
0
 public void SelectName()
 {
     NameTextbox.Select();
     NameTextbox.SelectAll();
 }
Пример #20
0
 private void name_textbox_GotFocus(object sender, RoutedEventArgs e)
 {
     NameTextbox.SelectAll();
 }
Пример #21
0
 private void NameTextbox_DoubleClick(object sender, EventArgs e)
 {
     NameTextbox.SelectAll();
 }
        void ReleaseDesignerOutlets()
        {
            if (CreateUserButton != null)
            {
                CreateUserButton.Dispose();
                CreateUserButton = null;
            }

            if (EmailAddress != null)
            {
                EmailAddress.Dispose();
                EmailAddress = null;
            }

            if (EmailTextbox != null)
            {
                EmailTextbox.Dispose();
                EmailTextbox = null;
            }

            if (LastnameLabel != null)
            {
                LastnameLabel.Dispose();
                LastnameLabel = null;
            }

            if (LastnameTextbox != null)
            {
                LastnameTextbox.Dispose();
                LastnameTextbox = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (NameTextbox != null)
            {
                NameTextbox.Dispose();
                NameTextbox = null;
            }

            if (PasswordLabel != null)
            {
                PasswordLabel.Dispose();
                PasswordLabel = null;
            }

            if (PasswordTextbox != null)
            {
                PasswordTextbox.Dispose();
                PasswordTextbox = null;
            }

            if (PhoneNumberLabel != null)
            {
                PhoneNumberLabel.Dispose();
                PhoneNumberLabel = null;
            }

            if (PhoneTextbox != null)
            {
                PhoneTextbox.Dispose();
                PhoneTextbox = null;
            }

            if (UserNameLabel != null)
            {
                UserNameLabel.Dispose();
                UserNameLabel = null;
            }

            if (UserNameTextbox != null)
            {
                UserNameTextbox.Dispose();
                UserNameTextbox = null;
            }
        }