public static void OpenModal( GameObject modalPrefab, string message, Transform parent ) { if (isModalOpen) { return; } GameObject modalObject = Instantiate( modalPrefab, new Vector3(0, 0, 0), Quaternion.identity ); currentModal = modalObject.GetComponent <Modal>(); currentModal.messageText.text = message; currentModal.transform.SetParent(parent); RectTransform modalRectTransform = modalObject.GetComponent <RectTransform>(); modalRectTransform.offsetMin = new Vector2(0, 0); modalRectTransform.offsetMax = new Vector2(0, 0); isModalOpen = true; currentOKButton = modalObject.transform.GetChild(1).GetComponent <OKButton>(); }
public override void StopAnimations() { base.StopAnimations(); DimmingInstance.StopAnimations(); LargeInfoFrameInstance.StopAnimations(); OKButton.StopAnimations(); }
private void DoEnter(KeyEventArgs enter) { if (enter.KeyCode == Keys.Enter) { OKButton.Focus(); } }
public void ValidatePassengersData() { FirstNameOfFirstPassengerField.Click(); FirstNameOfFirstPassengerField.SendKeys("Ion"); LastNameOfFirstPassengerField.Click(); LastNameOfFirstPassengerField.SendKeys("Ut"); SelectFirstPassengerGenderButton.Click(); Helper.ScrollToSeeTheFlights(_driver, FirstContinueButton); FirstContinueButton.Click(); FirstNameOfSecondPassengerField.Click(); FirstNameOfSecondPassengerField.SendKeys("Ele"); LastNameOfSecondPassengerField.Click(); LastNameOfSecondPassengerField.SendKeys("Na"); SelectSecondPassengerGenderButton.Click(); Helper.ScrollToSeeTheFlights(_driver, SecondContinueButton); SecondContinueButton.Click(); FirstNameOfThirdPassengerField.Click(); FirstNameOfThirdPassengerField.SendKeys("Lu"); LastNameOfThirdPassengerField.Click(); LastNameOfThirdPassengerField.SendKeys("Ca"); SelectThirdPassengerGenderButton.Click(); DateOfBirthField.Click(); SelectYearDropdown.Click(); ChooseYear.Click(); ChooseDay.Click(); Helper.ScrollToSeeTheFlights(_driver, OKButton); OKButton.Click(); ContinueWithSeatsButton.Click(); }
//private MySqlDataReader dane; public EditUserForm(MySqlDataReader rdr, string formname) { InitializeComponent(); this.Text = formname; if (formname == "Wyświetl dane użytkownika") { EditUserDataButton.Hide(); OKButton.Hide(); CancelButton.Text = "OK"; EdUserLoginTBox.Enabled = false; EdUserPassTBox.Enabled = false; EdUserFinancialTBox.Enabled = false; EdUserStatusCBox.Enabled = false; EdUserMailTBox.Enabled = false; EdUserNameTBox.Enabled = false; EdUserSurnameTBox.Enabled = false; } ImportData(rdr); rdr.Close(); IDLabel.Text += " " + id; EdUserLoginTBox.Text = login; EdUserPassTBox.Text = password; EdUserFinancialTBox.Text = financial.ToString(); EdUserStatusCBox.Text = status; EdUserNameTBox.Text = name; EdUserSurnameTBox.Text = surname; EdUserMailTBox.Text = email; //EdUserStatusTBox1.Text = status; }
void ShowMessage(string title, string message) { messageBox.Title = title; messageText.Text = message; messageBox.ShowDialog(); OKButton.Focus(); }
private void Input_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { OKButton.PerformClick(); } }
/// <summary> /// Sets the focus to the first custom control that is of an input type. /// </summary> private void SetFocus() { if (isMessageBox) { // If this is just a message box, set the focus to the visible "accept" button. if (YesButton.Visible) { YesButton.Focus(); } else { OKButton.Focus(); } } else { // Otherwise set the focus to the first input control. foreach (Control control in customControls) { if (control is TextBox || control is ComboBox || control is RichTextBox) { control.Focus(); return; } } } }
void ReleaseDesignerOutlets() { if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (OKButton != null) { OKButton.Dispose(); OKButton = null; } if (PasswordTxtField != null) { PasswordTxtField.Dispose(); PasswordTxtField = null; } if (UserNameTxtField != null) { UserNameTxtField.Dispose(); UserNameTxtField = null; } if (ServerTxtField != null) { ServerTxtField.Dispose(); ServerTxtField = null; } }
// Function when the start button is clicked. private void startButton_Click(object sender, EventArgs e) { // Change the welcome text back if the game has been restarted. introLabel.Text = "LET'S PLAY 20 QUESTIONS"; // Hide the initial prompt. promptLabel.Hide(); // Hide the text input controls if the game has been restarted. answerTextBox.Hide(); OKButton.Hide(); // Show the "yes" and "no" buttons. yesButton.Show(); noButton.Show(); // Change the start button's text accordingly. startButton.Text = "START OVER"; // Initialize the current node to the root. currentNode = tree.root; // Display the first question. questionLabel.Text = "Are they " + currentNode.Data + "?"; }
void CW_Loaded(object sender, RoutedEventArgs e) { Dispatcher.BeginInvoke(new Action(() => { OKButton.Focus(); })); }
// Function when the "no" button is clicked. private void noButton_Click(object sender, EventArgs e) { // If the current node is the last in the tree traversal... if (currentNode.No == null && currentNode.Yes == null) { // ...the player wins... introLabel.Text = "You win! Good game!"; // ...hide the "yes" and "no" buttons... yesButton.Hide(); noButton.Hide(); // ...show the text input controls... answerTextBox.Show(); OKButton.Show(); // ...and the computer asks who it was. questionLabel.Text = "Who is it?"; } else { // But if this isn't the last node in the tree traversal, move to the question node's "no" leaf node... currentNode = currentNode.No; // ...and ask the next question. questionLabel.Text = "Are they " + currentNode.Data + "?"; } }
// Windows form constructor. public Form1() { // Initialize the form. InitializeComponent(); // Hide irrelevant controls. yesButton.Hide(); noButton.Hide(); answerTextBox.Hide(); OKButton.Hide(); // Create a new binary search tree. tree = new BinTree(); // Build the new binary search tree. tree.FileInput(); // If the tree is empty (meaning the text file is blank or nonexistant)... if (tree.root == null) { // ...hide irrelevant controls... startButton.Hide(); questionLabel.Hide(); promptLabel.Hide(); // ...allow for multiple lines in the introduction text... introLabel.Size = new System.Drawing.Size(578, 200); // ...tell the player that the game cannot be played... introLabel.Text = "Sorry we can't play a game right now. Come back later after I learn something."; // ...and reposition the quit button to the center. quitButton.Location = new System.Drawing.Point(302, 316); } }
protected override async void OnDisappearingAnimationBegin() { if (!IsAnimationEnabled) { return; } var taskSource = new TaskCompletionSource <bool>(); var currentHeight = FrameContainer.Height; await Task.WhenAll( OKButton.FadeTo(0)); FrameContainer.Animate("HideAnimation", d => { FrameContainer.HeightRequest = d; }, start: currentHeight, end: 170, finished: async(d, b) => { await Task.Delay(300); taskSource.TrySetResult(true); }); await taskSource.Task; }
/// <summary> /// 密码输入框按下事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PassWordTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { OKButton.PerformClick(); } }
public AddAdminForm(string formname, int id_n) { InitializeComponent(); this.Text = formname; if (formname == "Dodawanie Administratora") { IDLabel.Hide(); choice = 1; } if (formname == "Edycja danych Administratora") { id = id_n; choice = 2; UpdateData(); } if (formname == "Wyświetlanie danych Administratora") { id = id_n; choice = 3; UpdateData(); LoginBox.Enabled = false; PasswordBox.Enabled = false; TypeBox.Enabled = false; OKButton.Hide(); ApplyButton.Hide(); CancelButton.Text = "OK"; } }
public ColorPickerWindow(Color color) { InitializeComponent(); ColorPickerControl.SetColor(color); Transfer.SelectedColor = color; OKButton.Focus(); }
private void Form1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { OKButton.PerformClick(); } }
//按下回车键触发OKButton的点击事件 private void OKButton_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; if (e.KeyChar == 13) //确定Enter { OKButton.PerformClick(); } }
private void PasswordText_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { e.Handled = true; OKButton.PerformClick(); } }
// Make 'Enter' the return key for the form. protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.Enter) { OKButton.PerformClick(); } return(base.ProcessCmdKey(ref msg, keyData)); }
private void CW_Loaded(object sender, RoutedEventArgs e) { Dispatcher.BeginInvoke(new Action(() => { OKButton.Focus(); })); if (string.IsNullOrEmpty(file)) { this.Close(); } }
public FileExtensionSettingWindow(AppDataObject appData) { this.AppData = appData; InitializeComponent(); TextBox.Text = appData.GetFileExtensionText(); OKButton.AddHandler(System.Windows.Controls.Primitives.ButtonBase.ClickEvent, new RoutedEventHandler(OnClicked)); }
public MergedNameSettingWindow(FileViewWindow fileViewWindow) { InitializeComponent(); this.fileViewWindow = fileViewWindow; TextBox.Text = ((FileDataObject)fileViewWindow.fileListView.SelectedItems[0]).Name; OKButton.AddHandler(System.Windows.Controls.Primitives.ButtonBase.ClickEvent, new RoutedEventHandler(okButton_OnClicked)); }
private void OnUserNameFieldKeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { e.Handled = true; OKButton.PerformClick(); } }
private void XrayStructureExportForm_Activated(object sender, EventArgs e) { if (ExportMarked.Checked && (FileName.Text == "" || FileName.Text.Contains("."))) { FileName.Text = ClientDirs.DefaultMobiusUserDocumentsFolder; } OKButton.Focus(); }
void ReleaseDesignerOutlets() { if (AddDieButton != null) { AddDieButton.Dispose(); AddDieButton = null; } if (BackgroundView != null) { BackgroundView.Dispose(); BackgroundView = null; } if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (DieTableView != null) { DieTableView.Dispose(); DieTableView = null; } if (HeaderLabel != null) { HeaderLabel.Dispose(); HeaderLabel = null; } if (HeaderView != null) { HeaderView.Dispose(); HeaderView = null; } if (ModButton != null) { ModButton.Dispose(); ModButton = null; } if (ModView != null) { ModView.Dispose(); ModView = null; } if (OKButton != null) { OKButton.Dispose(); OKButton = null; } }
void ReleaseDesignerOutlets() { if (BackgroundButton != null) { BackgroundButton.Dispose(); BackgroundButton = null; } if (BackgroundView != null) { BackgroundView.Dispose(); BackgroundView = null; } if (ButtonView != null) { ButtonView.Dispose(); ButtonView = null; } if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (FileNameText != null) { FileNameText.Dispose(); FileNameText = null; } if (FileTableView != null) { FileTableView.Dispose(); FileTableView = null; } if (OKButton != null) { OKButton.Dispose(); OKButton = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } if (TitleView != null) { TitleView.Dispose(); TitleView = null; } }
void ReleaseDesignerOutlets() { if (BackgroundView != null) { BackgroundView.Dispose(); BackgroundView = null; } if (BenefitButton != null) { BenefitButton.Dispose(); BenefitButton = null; } if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (NameButton != null) { NameButton.Dispose(); NameButton = null; } if (NormalButton != null) { NormalButton.Dispose(); NormalButton = null; } if (OKButton != null) { OKButton.Dispose(); OKButton = null; } if (PrerequisitesButton != null) { PrerequisitesButton.Dispose(); PrerequisitesButton = null; } if (SpecialButton != null) { SpecialButton.Dispose(); SpecialButton = null; } if (TypesButton != null) { TypesButton.Dispose(); TypesButton = null; } }
void ReleaseDesignerOutlets() { if (AttackButton != null) { AttackButton.Dispose(); AttackButton = null; } if (BackgroundView != null) { BackgroundView.Dispose(); BackgroundView = null; } if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (CountButton != null) { CountButton.Dispose(); CountButton = null; } if (DamageButton != null) { DamageButton.Dispose(); DamageButton = null; } if (HeaderLabel != null) { HeaderLabel.Dispose(); HeaderLabel = null; } if (HeaderView != null) { HeaderView.Dispose(); HeaderView = null; } if (OKButton != null) { OKButton.Dispose(); OKButton = null; } if (PlusButton != null) { PlusButton.Dispose(); PlusButton = null; } }