private void ButtonYes_Click(object sender, EventArgs e) { List <Control> controlsToRemove = new List <Control>() { labelQuestion, buttonNo.Key, buttonNo.Value, buttonYes.Key, buttonYes.Value }; foreach (Control control in controlsToRemove) { Controls.Remove(control); } maskedTextBox.Visible = true; SetLabelsText( Properties.Settings.Default.TextCallbackFormHeaderEnterNumber, Properties.Settings.Default.TextCallbackFormSubtitleEnterNumber); OnscreenKeyboard onscreenKeyboard = new OnscreenKeyboard( maskedTextBox, availableWidth, availableHeight, startX, startY, gap, fontSize, OnscreenKeyboard.KeyboardType.Number); Panel panelKeyboard = onscreenKeyboard.CreateOnscreenKeyboard(); Controls.Add(panelKeyboard); panelKeyboard.Location = new Point( panelKeyboard.Location.X, startY + availableHeight / 2 - panelKeyboard.Height / 2); buttonNext = CreateDefaultButton( startX + availableWidth - buttonClose.Key.Width, buttonClose.Key.Location.Y, Properties.Resources.ButtonOk); buttonNext.Key.BackColor = Properties.Settings.Default.ColorButtonOk; buttonNext.Key.Click += ButtonNext_Click; SetButtonNextVisible(false); SetLogoVisible(false); int maskedWidth = (int)(panelKeyboard.Width * 1.5); maskedTextBox.Font = new Font(Properties.Settings.Default.FontSub.FontFamily, (int)(fontSize * 1.3)); maskedTextBox.SetBounds( startX + availableWidth / 2 - maskedWidth / 2, panelKeyboard.Location.Y - gap - buttonClose.Key.Height, maskedWidth, buttonClose.Key.Height); maskedTextBox.Location = new Point(maskedTextBox.Location.X, panelKeyboard.Location.Y - maskedTextBox.Height - gap); maskedTextBox.TextChanged += MaskedTextBox_TextChanged; }
public FormComment() { InitializeComponent(); //SetButtonCloseVisible(false); SetLabelsText( Properties.Settings.Default.TextCommentFormHeader, Properties.Settings.Default.TextCommentFromSubtitle); SetLogoVisible(false); OnscreenKeyboard onscreenKeyboard = new OnscreenKeyboard( textBox, availableWidth, availableHeight, startX, startY, gap, fontSize, OnscreenKeyboard.KeyboardType.Full); Panel panelKeyboard = onscreenKeyboard.CreateOnscreenKeyboard(); Controls.Add(panelKeyboard); textBox.Font = new Font(Properties.Settings.Default.FontSub.FontFamily, fontSize); textBox.SetBounds(startX, startY, availableWidth, availableHeight - gap - panelKeyboard.Height); KeyValuePair <Button, PictureBox> buttonNext = CreateDefaultButton( startX + availableWidth - buttonClose.Key.Width, buttonClose.Key.Location.Y, Properties.Resources.BackNext); buttonNext.Key.BackColor = Properties.Settings.Default.ColorButtonOk; buttonNext.Key.Click += ButtonNext_Click; KeyValuePair <Button, PictureBox> buttonClear = CreateDefaultButton( startX + availableWidth - buttonClose.Key.Width, textBox.Location.Y + textBox.Height + gap, Properties.Resources.ButtonClear); buttonClear.Key.Click += ButtonClear_Click; }
public FormSearch(Dictionary <string, List <Doctor> > dictionaryOfDoctors) { Console.WriteLine("FormSearch"); InitializeComponent(); this.dictionaryOfDoctors = dictionaryOfDoctors; SetLabelsText( Properties.Settings.Default.TextSearchFormHeader, Properties.Settings.Default.TextSearchFormSubtitleEmpty); SetLogoVisible(false); OnscreenKeyboard onscreenKeyboard = new OnscreenKeyboard( textBox, availableWidth, availableHeight, startX, startY, gap, fontSize, OnscreenKeyboard.KeyboardType.Short); Panel panelKeyboard = onscreenKeyboard.CreateOnscreenKeyboard(); Controls.Add(panelKeyboard); textBox.Font = new Font(Properties.Settings.Default.FontSub.FontFamily, fontSize); textBox.SetBounds(panelKeyboard.Location.X, startY, panelKeyboard.Width, buttonClose.Key.Height); textBox.Focus(); textBox.TextChanged += TextBox_TextChanged; KeyValuePair <Button, PictureBox> buttonClear = CreateDefaultButton( textBox.Location.X + textBox.Width + gap, textBox.Location.Y, Properties.Resources.ButtonClear); buttonClear.Key.Click += ButtonClear_Click; int panelResultX = startX; int panelResultY = textBox.Location.Y + textBox.Height + gap; panelResultWidth = availableWidth; panelResultHeight = panelKeyboard.Location.Y - gap - panelResultY; panelResult = new Panel(); panelResult.SetBounds( panelResultX - leftCornerShadow, panelResultY - leftCornerShadow, panelResultWidth + leftCornerShadow + rightCornerShadow, panelResultHeight + leftCornerShadow + rightCornerShadow); Controls.Add(panelResult); if (Properties.Settings.Default.IsDebugMode) { textBox.BackColor = Color.AliceBlue; panelResult.BackColor = Color.AliceBlue; } buttonScrollLeft = CreateDefaultButton( startX, panelResult.Location.Y + panelResult.Height + gap - rightCornerShadow, Properties.Resources.ButtonLeft); buttonScrollLeft.Key.Click += ButtonLeft_Click; buttonScrollRight = CreateDefaultButton( startX + availableWidth - buttonClose.Key.Width, buttonScrollLeft.Key.Location.Y, Properties.Resources.ButtonRight); buttonScrollRight.Key.Click += ButtonRight_Click; labelInfo = CreateLabel("", panelResult.Location.X, panelResult.Location.Y, panelResult.Width, panelResult.Height); SetLabelInfoToInitial(); onscreenKeyboard.SetEnterButtonClick(ButtonEnter_Click); }