void ReleaseDesignerOutlets() { if (ButtonCancel != null) { ButtonCancel.Dispose(); ButtonCancel = null; } if (ButtonUpdate != null) { ButtonUpdate.Dispose(); ButtonUpdate = null; } if (MapViewAddress != null) { MapViewAddress.Dispose(); MapViewAddress = null; } if (TextFieldEmail != null) { TextFieldEmail.Dispose(); TextFieldEmail = null; } if (TextFieldName != null) { TextFieldName.Dispose(); TextFieldName = null; } }
void ReleaseDesignerOutlets() { if (ButtonAnswer != null) { ButtonAnswer.Dispose(); ButtonAnswer = null; } if (ButtonCancel != null) { ButtonCancel.Dispose(); ButtonCancel = null; } if (LabelAwesome != null) { LabelAwesome.Dispose(); LabelAwesome = null; } if (LabelCongrats != null) { LabelCongrats.Dispose(); LabelCongrats = null; } if (LabelHint != null) { LabelHint.Dispose(); LabelHint = null; } if (LabelQuestNumber != null) { LabelQuestNumber.Dispose(); LabelQuestNumber = null; } }
private void ListBox1_SelectedIndexChanged(object sender, EventArgs e) { PictureBox1.Image = Image.FromFile(@"..\..\foto\fotocap.jpg"); try { for (int i = 0; i < lstPerson.Count; i++) { if ((lstPerson[i].surname + " " + lstPerson[i].name) == ListBox1.SelectedItem.ToString()) { TextBoxSurname.Text = lstPerson[i].surname; TextBoxName.Text = lstPerson[i].name; MaskedTBPhone.Text = lstPerson[i].phone; TextBoxEmail.Text = lstPerson[i].email; LabelNumber.Text = lstPerson[i].number.ToString(); if (lstPerson[i].picture != "") { PictureBox1.Image = Image.FromFile(lstPerson[i].picture); PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; } ButtonAdd.Hide(); ButtonCLear.Hide(); ButtonSave.Show(); ButtonDell.Show(); ButtonCancel.Show(); break; } } } catch (NullReferenceException) { } }
private void Form1_Load(object sender, EventArgs e) { //ButtonSave.Enabled = false; //ButtonDell.Enabled = false; //ButtonCancel.Enabled = false; ButtonSave.Hide(); ButtonDell.Hide(); ButtonCancel.Hide(); ReadText("ankets.txt"); }
private void ButtonCancel_Click(object sender, EventArgs e) { ListBox1.ClearSelected(); CLearFields(); ButtonAdd.Show(); ButtonCLear.Show(); ButtonSave.Hide(); ButtonDell.Hide(); ButtonCancel.Hide(); }
private void CheckSubScriptionId() { CurrentSubscriptionBilling = null; BindingOperations.GetBindingExpression(FirstControl, TextBox.TextProperty).UpdateSource(); MessageDialog Msg = null; try { bool IsValid = true; string SId = ""; ControlsValidate?Vd = Commons.ValidateData((Control)FirstControl, ControlsArraySubScriptionId); if (Vd != null) { IsValid = false; Msg = new MessageDialog(Messages.SaveMessageTitleBillsCancelling, Messages.ForceToSubscriptionId, MessageDialogButtons.Ok, MessageDialogType.Warning, GridHeader.Background); Msg.Owner = Window.GetWindow(this); Msg.ShowDialog(); EmptyControl(); FirstControl.Focus(); FirstControl.SelectAll(); } if (IsValid == true) { SId = TextBoxSubScriptionId.Text.Trim(); CurrentSubscriptionBilling = LoadSubscriptionForBilling(SId); if (CurrentSubscriptionBilling != null) { FillSubScription(CurrentSubscriptionBilling); ButtonCancel.Focus(); } else { Msg = new MessageDialog(Messages.SaveMessageTitleBillsCancelling, Messages.NotFoundSubscriptionOrBillForCancelling, MessageDialogButtons.Ok, MessageDialogType.Warning, GridHeader.Background); Msg.Owner = Window.GetWindow(this); Msg.ShowDialog(); EmptyControl(); FirstControl.Focus(); FirstControl.SelectAll(); } } } catch { Msg = new MessageDialog(Messages.SaveMessageTitleBillsCancelling, Messages.ErrorSendingDataToDatabase, MessageDialogButtons.Ok, MessageDialogType.Error, GridHeader.Background); Msg.Owner = Window.GetWindow(this); Msg.ShowDialog(); FirstControl.Focus(); FirstControl.SelectAll(); } }
void ReleaseDesignerOutlets() { if (Image != null) { Image.Dispose(); Image = null; } if (HeaderText != null) { HeaderText.Dispose(); HeaderText = null; } if (FooterText != null) { FooterText.Dispose(); FooterText = null; } if (ButtonDetails != null) { ButtonDetails.Dispose(); ButtonDetails = null; } if (ButtonCancel != null) { ButtonCancel.Dispose(); ButtonCancel = null; } if (ButtonSend != null) { ButtonSend.Dispose(); ButtonSend = null; } if (Details != null) { Details.Dispose(); Details = null; } if (ScrollView != null) { ScrollView.Dispose(); ScrollView = null; } }
public override void OnKeyDown(Keys k) { base.OnKeyDown(k); switch (k) { case Keys.Escape: ButtonCancel.Press(); break; case Keys.Enter: ButtonOk.Press(); break; } }
public void useSelada() { countSelad = int.Parse(Selada.text); if (countSelad > 0 && statRockwool == "True") { cancelTanam.SetActive(true); UIRockwool.SetActive(true); BagUI.SetActive(false); statTanam = true; usageStatus = "Seed Selada"; statusSeed.text = usageStatus; countSeed.text = countSelad.ToString(); status.SetActive(true); ButtonCancel.SetActive(true); reference.Child(id).Child("Management").Child("Usage Status").SetValueAsync(usageStatus); reference.Child(id).Child("Management").Child("Status Tanam").SetValueAsync(statTanam); } }
public CustomOverlayView() : base() { lineseparator = new UIView() { BackgroundColor = UIColor.White }; nfloat pi = (nfloat)Math.PI; lefttop = new UIImageView() { Image = UIImage.FromFile("LeftBottom"), Transform = CGAffineTransform.MakeRotation((pi * 90 / 180)) }; leftbottom = new UIImageView() { Image = UIImage.FromFile("LeftBottom"), }; righttop = new UIImageView() { Image = UIImage.FromFile("LeftBottom"), Transform = CGAffineTransform.MakeRotation((pi * 180 / 180)) }; rightbottom = new UIImageView() { Image = UIImage.FromFile("LeftBottom"), Transform = CGAffineTransform.MakeRotation((pi * -90 / 180)) }; ButtonTorch = UIButton.FromType(UIButtonType.RoundedRect); ButtonTorch.SetTitle("Bật Flash", UIControlState.Normal); ButtonTorch.SetTitleColor(UIColor.White, UIControlState.Normal); ButtonTorch.Layer.BorderWidth = 2; ButtonTorch.Layer.BorderColor = UIColor.White.CGColor; ButtonTorch.Layer.CornerRadius = 5; ButtonCancel = UIButton.FromType(UIButtonType.RoundedRect); ButtonCancel.SetTitle("Hủy", UIControlState.Normal); ButtonCancel.SetTitleColor(UIColor.White, UIControlState.Normal); ButtonCancel.Layer.BorderWidth = 2; ButtonCancel.Layer.BorderColor = UIColor.White.CGColor; ButtonCancel.Layer.CornerRadius = 5; this.AddSubviews(lineseparator, lefttop, leftbottom, rightbottom, righttop, ButtonCancel, ButtonTorch); }
private void ButtonDell_Click(object sender, EventArgs e) { int tem = Convert.ToInt32(LabelNumber.Text); for (int i = 0; i < lstPerson.Count; i++) { if (lstPerson[i].number == tem) { lstPerson.RemoveAt(i); ListBox1.Items.RemoveAt(ListBox1.SelectedIndex); CLearFields(); ButtonAdd.Show(); ButtonCLear.Show(); ButtonSave.Hide(); ButtonDell.Hide(); ButtonCancel.Hide(); break; } } }
private void ButtonSave_Click(object sender, EventArgs e) { int tem = Convert.ToInt32(LabelNumber.Text); for (int i = 0; i < lstPerson.Count; i++) { if (lstPerson[i].number == tem) { if (TextBoxName.Text == "" || TextBoxSurname.Text == "" || TextBoxEmail.Text == "" || MaskedTBPhone.Text == "") { MessageBox.Show("Заполнены не все данные!"); } else { lstPerson[i].surname = TextBoxSurname.Text; lstPerson[i].name = TextBoxName.Text; lstPerson[i].phone = MaskedTBPhone.Text; lstPerson[i].email = TextBoxEmail.Text; if (nameFoto != "") { lstPerson[i].picture = nameFoto; } ListBox1.Items[ListBox1.SelectedIndex] = lstPerson[i].surname + " " + lstPerson[i].name; CLearFields(); ButtonAdd.Show(); ButtonCLear.Show(); ButtonSave.Hide(); ButtonDell.Hide(); ButtonCancel.Hide(); break; } } } nameFoto = ""; PictureBox1.Image = Image.FromFile(@"..\..\foto\fotocap.jpg"); }
private void BtnCancel_Click(object sender, EventArgs e) { ButtonCancel?.Invoke(sender, e); }
public Alerts(string LabelTitle, string LabelSubTitle, string LabelText, byte QuantityButtons = 3, string Button1 = "", string Button2 = "", string Button3 = "OK", TypeIcon Option = TypeIcon.Info) { InitializeComponent(); ArrayButton = new Button[] { ButtonYes, ButtonNo, ButtonCancel }; this.QuantityButtons = QuantityButtons; this.LabelTitle.Text = LabelTitle; this.LabelSubTitle.Text = LabelSubTitle; this.LabelText.Text = LabelText; ButtonYes.Text = Button1.Trim(); ButtonNo.Text = Button2.Trim(); ButtonCancel.Text = Button3.Trim(); switch (Option) { case TypeIcon.Info: default: { PictureBoxIcon.Image = Resources.InformationWhite; break; } case TypeIcon.Warning: { PictureBoxIcon.Image = Resources.WarningWhite; break; } case TypeIcon.Danger: { PictureBoxIcon.Image = Resources.BugWhite; break; } } switch (QuantityButtons) { case 1: { ButtonYes.Hide(); ButtonNo.Hide(); ButtonCancel.Show(); ButtonCancel.DialogResult = DialogResult.OK; break; } case 2: { ButtonYes.Hide(); ButtonNo.Show(); ButtonNo.DialogResult = DialogResult.Yes; ButtonCancel.Show(); ButtonCancel.DialogResult = DialogResult.No; break; } case 3: default: { ButtonYes.Show(); ButtonYes.DialogResult = DialogResult.Yes; ButtonNo.Show(); ButtonNo.DialogResult = DialogResult.No; ButtonCancel.Show(); ButtonCancel.DialogResult = DialogResult.Cancel; } break; } } //Clave de Método: Alerts-C
public DialogWindow(Window parent, string message, string title, MessageBoxButton messageBoxButton, MessageBoxImage messageBoxImage) : base() { InitializeComponent(); Closing += new CancelEventHandler(DialogWindow_Closing); Owner = parent; Title = title; LabelContent.Text = message; if (Owner == null) { WindowStartupLocation = WindowStartupLocation.CenterScreen; } if (messageBoxButton == MessageBoxButton.OK || messageBoxButton == MessageBoxButton.OKCancel) { ButtonOk.Visibility = Visibility.Visible; ButtonOk.Click += new RoutedEventHandler(ButtonOk_Click); ButtonOk.Focus(); } if (messageBoxButton == MessageBoxButton.YesNo || messageBoxButton == MessageBoxButton.YesNoCancel) { ButtonYes.Visibility = Visibility.Visible; ButtonNo.Visibility = Visibility.Visible; ButtonNo.Focus(); ButtonYes.Click += new RoutedEventHandler(ButtonYes_Click); ButtonNo.Click += new RoutedEventHandler(ButtonNo_Click); } if (messageBoxButton == MessageBoxButton.OKCancel || messageBoxButton == MessageBoxButton.YesNoCancel) { ButtonCancel.Visibility = Visibility.Visible; ButtonCancel.Focus(); ButtonCancel.Click += new RoutedEventHandler(ButtonCancel_Click); } if (messageBoxImage != MessageBoxImage.None) { Image.Visibility = Visibility.Visible; switch (messageBoxImage) { case MessageBoxImage.Information: Image.Source = Imaging.CreateBitmapSourceFromHIcon(System.Drawing.SystemIcons.Information.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); System.Media.SystemSounds.Asterisk.Play(); break; case MessageBoxImage.Question: Image.Source = Imaging.CreateBitmapSourceFromHIcon(System.Drawing.SystemIcons.Question.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); System.Media.SystemSounds.Question.Play(); break; case MessageBoxImage.Exclamation: Image.Source = Imaging.CreateBitmapSourceFromHIcon(System.Drawing.SystemIcons.Exclamation.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); System.Media.SystemSounds.Exclamation.Play(); break; case MessageBoxImage.Error: Image.Source = Imaging.CreateBitmapSourceFromHIcon(System.Drawing.SystemIcons.Error.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); System.Media.SystemSounds.Hand.Play(); break; } } ShowDialog(); }
public SettingsPage() { SuspendLayout(); TBLayout.SuspendLayout(); ContentSettings.SuspendLayout(); ((ISupportInitialize)(BlueTrackBar)).BeginInit(); ((ISupportInitialize)(GreenTrackBar)).BeginInit(); ((ISupportInitialize)(RedTrackBar)).BeginInit(); Controls.Add(TBLayout); Controls.Add(ContentSettings); Name = "SettingsPage"; RedTextBox.AddColor1(); RedTextBox.ValueChanged += new EventHandler(RedChanged); GreenTextBox.AddColor1(); GreenTextBox.ValueChanged += new EventHandler(GreenChanged); BlueTextBox.AddColor1(); BlueTextBox.ValueChanged += new EventHandler(BlueChanged); ButtonAccept.AddColor1(); ButtonAccept.Click += new EventHandler(AcceptChange); ButtonCancel.AddColor1(); ButtonCancel.Click += new EventHandler(CancelChange); DefaultButton.AddColor1(); DefaultButton.Click += new EventHandler(ChangeDefault); BlueTrackBar.Scroll += new EventHandler(BlueTrack_Scroll); RedTrackBar.Scroll += new EventHandler(RedTrack_Scroll); GreenTrackBar.Scroll += new EventHandler(GreenTrack_Scroll); CheckToolTip.CheckedChanged += new EventHandler(SetCheckedToolTip); CheckEventLog.CheckedChanged += new EventHandler(SetCheckEventLog); DefaultButton.UseVisualStyleBackColor = false; // TBLayout TBLayout.ColumnCount = 3; TBLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F)); TBLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F)); TBLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F)); TBLayout.Controls.Add(ButtonCancel, 1, 0); TBLayout.Controls.Add(DefaultButton, 0, 0); TBLayout.Controls.Add(ButtonAccept, 2, 0); TBLayout.Location = new Point(58, 479); TBLayout.Margin = new Padding(0, 0, 0, 7); TBLayout.Name = "TBLayout"; TBLayout.RowCount = 1; TBLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); TBLayout.Size = new Size(422, 35); TBLayout.TabIndex = 1; // // ContentSettings ContentSettings.AutoScroll = true; ContentSettings.HorizontalScroll.Enabled = false; ContentSettings.Controls.Add(BlueTextBox); ContentSettings.Controls.Add(GreenTextBox); ContentSettings.Controls.Add(RedTextBox); ContentSettings.Controls.Add(BlueLabel); ContentSettings.Controls.Add(GreenLabel); ContentSettings.Controls.Add(RedLabel); ContentSettings.Controls.Add(BlueTrackBar); ContentSettings.Controls.Add(GreenTrackBar); ContentSettings.Controls.Add(RedTrackBar); ContentSettings.Controls.Add(EditColor); ContentSettings.Controls.Add(ColorDefault); ContentSettings.Controls.Add(TitleChangeColor); ContentSettings.Controls.Add(CheckToolTip); ContentSettings.Controls.Add(CheckEventLog); ContentSettings.Location = new Point(7, 7); ContentSettings.Margin = new Padding(7); ContentSettings.Name = "ContentSettings"; ContentSettings.Size = new Size(473, 465); ContentSettings.TabIndex = 0; ContentSettings.BackColor = RedGreenBlue.Color1; ResumeLayout(false); TBLayout.ResumeLayout(false); ContentSettings.ResumeLayout(false); ContentSettings.PerformLayout(); ((ISupportInitialize)(BlueTrackBar)).EndInit(); ((ISupportInitialize)(GreenTrackBar)).EndInit(); ((ISupportInitialize)(RedTrackBar)).EndInit(); }
private void ButtonSave_Click(object sender, RoutedEventArgs e) { ControlsValidate?Vd = Commons.ValidateData(FirstControl, ControlsArray); MessageDialog Msg = null; if (Commons.CPeriod.Id > 0 && Commons.CPeriod.IsClosed == false) { if (Vd != null) { Msg = new MessageDialog(Messages.SaveMessageTitleBillsCancelling, Vd.Value.Message, MessageDialogButtons.Ok, MessageDialogType.Warning, GridHeader.Background); Msg.Owner = Window.GetWindow(this); Msg.ShowDialog(); Vd.Value.Control.Focus(); } else { DomainClasses.SubscriptionsTb MySubscription = CurrentSubscriptionBilling.SubScription; //در صورتی که قبض مربوطه مربوط به کنتور قبلی باشد امکان ابطال آن وجود ندارد if (CurrentSubscriptionBilling.SubScription.WaterMeterId == CurrentSubscriptionBilling.Bill.WaterMeterId && CurrentSubscriptionBilling.SubScription.WaterMeterYear == CurrentSubscriptionBilling.Bill.WaterMeterYear) { Msg = new MessageDialog(Messages.SaveMessageTitleBillsCancelling, Messages.SaveMessageBillsCancelling, MessageDialogButtons.YesNo, MessageDialogType.Warning, GridHeader.Background); Msg.Owner = Window.GetWindow(this); if (Msg.ShowDialog() == true) { try { long PrevDebt = CurrentSubscriptionBilling.Bill.PrevDebt; long PrevDeficit1000 = CurrentSubscriptionBilling.Bill.Prevdeficit1000; string PrevPrevReadDate = CurrentSubscriptionBilling.Bill.PrevPrevReadDate , PrevReadDate = MySubscription.PrevReadDate; long PrevPrevNumber = CurrentSubscriptionBilling.Bill.PrevPrevNumber , PrevNumber = MySubscription.PrevNumber; if (CurrentSubscriptionBilling.Bill.Status == BillsStatus.ReceivableFull || CurrentSubscriptionBilling.Bill.Status == BillsStatus.ReceivableNotMatch) { PrevDebt = PrevDebt - CurrentSubscriptionBilling.Bill.ReceivablePrice; PrevDeficit1000 = PrevDeficit1000 - CurrentSubscriptionBilling.Bill.ReceivableDefict1000; } CurrentSubscriptionBilling.Bill.CancelDate = Commons.GetCurrentPersianDate(); CurrentSubscriptionBilling.Bill.Status = BillsStatus.Cancel; MySubscription.Debt = PrevDebt; MySubscription.deficit1000 = PrevDeficit1000; MySubscription.PrevReadDate = PrevPrevReadDate; MySubscription.PrevNumber = PrevPrevNumber; MySubscription.CurrentReadDate = PrevReadDate; MySubscription.CurrentNumber = PrevNumber; //به روز رسانی آخرین قرائت با کنتور فعلی MySubscription.WaterMeter.ReadEnd = PrevNumber; MySubscription.WaterMeter.ReadDateEnd = PrevReadDate; Commons.Db.SaveChanges(); Msg = new MessageDialog(Messages.SaveMessageTitleBillsCancelling, Messages.SaveMessageSuccessBillsCancelling, MessageDialogButtons.Ok, MessageDialogType.Information, GridHeader.Background); Msg.Owner = Window.GetWindow(this); Msg.ShowDialog(); EmptyControl(); TextBoxSubScriptionId.Text = ""; TextBoxSubScriptionId.Focus(); TextBoxSubScriptionId.SelectAll(); } catch { Msg = new MessageDialog(Messages.SaveMessageTitleBillsCancelling, Messages.ErrorSendingDataToDatabase, MessageDialogButtons.Ok, MessageDialogType.Error, GridHeader.Background); Msg.Owner = Window.GetWindow(this); Msg.ShowDialog(); ButtonCancel.Focus(); } } } //در صورتی که قبض مربوطه مربوط به کنتور قبلی باشد امکان ابطال آن وجود ندارد else { Msg = new MessageDialog(Messages.SaveMessageTitleBillsCancelling, Messages.CanNotCancelBillBecauseOfWaterMeter, MessageDialogButtons.Ok, MessageDialogType.Warning, GridHeader.Background); Msg.Owner = Window.GetWindow(this); Msg.ShowDialog(); ButtonCancel.Focus(); } } } else { Msg = new MessageDialog(Messages.SaveMessageTitleBillsCancelling, Messages.NotExistPeriodBilling, MessageDialogButtons.Ok, MessageDialogType.Warning, GridHeader.Background); Msg.Owner = Window.GetWindow(this); Msg.ShowDialog(); TextBoxSubScriptionId.Text = ""; TextBoxSubScriptionId.Focus(); TextBoxSubScriptionId.SelectAll(); } }
private void ButtonCancel_GotFocus(object sender, RoutedEventArgs e) { ButtonCancel.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); }
private void BtnCancelAddOrModifyExercise_Click(object sender, EventArgs e) { ButtonCancel?.Invoke(sender, e); }