public MainForm () { // // _textBox1 // _textBox1 = new MaskedTextBox (); _textBox1.Location = new Point (8, 8); _textBox1.Mask = "LL/LLL"; _textBox1.Size = new Size (280, 20); _textBox1.UseSystemPasswordChar = true; Controls.Add (_textBox1); // // _textBox2 // _textBox2 = new MaskedTextBox (); _textBox2.Location = new Point (8, 40); _textBox2.PasswordChar = '%'; _textBox2.Size = new Size (280, 20); Controls.Add (_textBox2); // // _maskedTextProvider // _maskedTextProvider = new MaskedTextProvider ("LL/LL/LLLL"); _maskedTextProvider.PasswordChar = '@'; _maskedTextProvider.PromptChar = '?'; // // _textBox3 // _textBox3 = new MaskedTextBox (_maskedTextProvider); _textBox3.Location = new Point (8, 72); _textBox3.Size = new Size (280, 20); Controls.Add (_textBox3); // // MainForm // ClientSize = new Size (300, 110); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #360390"; Load += new EventHandler (MainForm_Load); }
/// <summary> /// Занесение в TextBox выбранной папки /// </summary> /// <param name="tb"></param> private void OpenFolder(MaskedTextBox tb) { var openDialog = new FolderBrowserDialog(); DialogResult result = openDialog.ShowDialog(); if (result == DialogResult.OK) { tb.Text = openDialog.SelectedPath; } }
private static void Add(MaskedTextBox focusedTextBox) { maskedName.Add(focusedTextBox); }
public static FrameworkElement GetBsonValueEditor( OpenEditorMode openMode, string bindingPath, BsonValue bindingValue, object bindingSource, bool readOnly, string keyName) { var binding = new Binding { Path = new PropertyPath(bindingPath), Source = bindingSource, Mode = BindingMode.TwoWay, Converter = new BsonValueToNetValueConverter(), UpdateSourceTrigger = UpdateSourceTrigger.Explicit }; if (bindingValue.IsArray) { var arrayValue = bindingValue as BsonArray; if (openMode == OpenEditorMode.Window) { var button = new Button { Content = $"[Array] {arrayValue?.Count} {keyName}", Style = StyleKit.MaterialDesignEntryButtonStyle }; button.Click += (s, a) => { arrayValue = bindingValue as BsonArray; var windowController = new WindowController { Title = "Array Editor" }; var control = new ArrayEntryControl(arrayValue, readOnly, windowController); var window = new DialogWindow(control, windowController) { Owner = Application.Current.MainWindow, Height = DefaultWindowHeight, MinWidth = 400, MinHeight = 400, }; if (window.ShowDialog() == true) { arrayValue?.Clear(); arrayValue?.AddRange(control.EditedItems); button.Content = $"[Array] {arrayValue?.Count} {keyName}"; } }; return(button); } var contentView = new ContentExpander { LoadButton = { Content = $"[Array] {arrayValue?.Count} {keyName}" } }; contentView.LoadButton.Click += (s, a) => { if (contentView.ContentLoaded) { return; } arrayValue = bindingValue as BsonArray; var control = new ArrayEntryControl(arrayValue, readOnly); control.CloseRequested += (sender, args) => { contentView.Content = null; }; contentView.Content = control; }; return(contentView); } if (bindingValue.IsDocument) { var expandLabel = "[Document]"; if (openMode == OpenEditorMode.Window) { var button = new Button { Content = expandLabel, Style = StyleKit.MaterialDesignEntryButtonStyle }; button.Click += (s, a) => { var windowController = new WindowController { Title = "Document Editor" }; var bsonDocument = bindingValue as BsonDocument; var control = new DocumentEntryControl(bsonDocument, readOnly, windowController); var window = new DialogWindow(control, windowController) { Owner = Application.Current.MainWindow, Height = DefaultWindowHeight, MinWidth = 400, MinHeight = 400, }; window.ShowDialog(); }; return(button); } var contentView = new ContentExpander { LoadButton = { Content = expandLabel } }; contentView.LoadButton.Click += (s, a) => { if (contentView.ContentLoaded) { return; } var bsonDocument = bindingValue as BsonDocument; var control = new DocumentEntryControl(bsonDocument, readOnly); control.CloseRequested += (sender, args) => { contentView.Content = null; }; contentView.Content = control; }; return(contentView); } if (bindingValue.IsBoolean) { var check = new CheckBox { IsEnabled = !readOnly, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 0, 0) }; check.SetBinding(ToggleButton.IsCheckedProperty, binding); return(check); } if (bindingValue.IsDateTime) { var datePicker = new DateTimePicker { TextAlignment = TextAlignment.Left, IsReadOnly = readOnly, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 0, 0), }; datePicker.SetBinding(DateTimePicker.ValueProperty, binding); return(datePicker); } if (bindingValue.IsDouble) { var numberEditor = new DoubleUpDown { TextAlignment = TextAlignment.Left, IsReadOnly = readOnly, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 0, 0) }; numberEditor.SetBinding(DoubleUpDown.ValueProperty, binding); return(numberEditor); } if (bindingValue.IsDecimal) { var numberEditor = new DecimalUpDown { TextAlignment = TextAlignment.Left, IsReadOnly = readOnly, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 0, 0) }; numberEditor.SetBinding(DecimalUpDown.ValueProperty, binding); return(numberEditor); } if (bindingValue.IsInt32) { var numberEditor = new IntegerUpDown { TextAlignment = TextAlignment.Left, IsReadOnly = readOnly, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 0, 0) }; numberEditor.SetBinding(IntegerUpDown.ValueProperty, binding); return(numberEditor); } if (bindingValue.IsInt64) { var numberEditor = new LongUpDown { TextAlignment = TextAlignment.Left, IsReadOnly = readOnly, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 0, 0) }; numberEditor.SetBinding(LongUpDown.ValueProperty, binding); return(numberEditor); } if (bindingValue.IsGuid || bindingValue.Type == BsonType.Guid) { var guidEditor = new MaskedTextBox { IsReadOnly = readOnly, VerticalAlignment = VerticalAlignment.Center, Mask = @"AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA", ValueDataType = typeof(Guid) }; guidEditor.SetBinding(MaskedTextBox.ValueProperty, binding); return(guidEditor); } if (bindingValue.IsString) { var stringEditor = new TextBox { IsReadOnly = readOnly, AcceptsReturn = true, VerticalAlignment = VerticalAlignment.Center, MaxHeight = 200, MaxLength = 1024, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, }; stringEditor.SetBinding(TextBox.TextProperty, binding); return(stringEditor); } if (bindingValue.IsBinary) { var text = new TextBlock { Text = "[Binary Data]", VerticalAlignment = VerticalAlignment.Center, }; return(text); } if (bindingValue.IsObjectId) { var text = new TextBox { Text = bindingValue.AsString, IsReadOnly = true, VerticalAlignment = VerticalAlignment.Center, }; return(text); } var defaultEditor = new TextBox { VerticalAlignment = VerticalAlignment.Center, MaxHeight = 200, MaxLength = 1024, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, }; defaultEditor.SetBinding(TextBox.TextProperty, binding); return(defaultEditor); }
public CadastroCliente(Form parent) { this.BackColor = ColorTranslator.FromHtml("#898989"); this.Font = new Font(this.Font, FontStyle.Bold); this.Size = new Size(600, 500); this.parent = parent; pb_Cadastro = new PictureBox(); pb_Cadastro.Location = new Point(10, 10); pb_Cadastro.Size = new Size(500, 200); pb_Cadastro.ClientSize = new Size(500, 70); pb_Cadastro.BackColor = Color.Black; pb_Cadastro.Load("./Views/assets/senac.jpg"); pb_Cadastro.SizeMode = PictureBoxSizeMode.StretchImage; this.Controls.Add(pb_Cadastro); lbl_Nome = new Label(); lbl_Nome.Text = "Nome :"; lbl_Nome.Location = new Point(25, 100); lbl_Nome.AutoSize = true; this.Controls.Add(lbl_Nome); lbl_DataNasc = new Label(); lbl_DataNasc.Text = "Data de Nascimento :"; lbl_DataNasc.AutoSize = true; lbl_DataNasc.Location = new Point(25, 140); this.Controls.Add(lbl_DataNasc); lbl_CPF = new Label(); lbl_CPF.Text = "CPF :"; lbl_CPF.Location = new Point(25, 180); this.Controls.Add(lbl_CPF); lbl_DiasDevol = new Label(); lbl_DiasDevol.Text = "Dias Devolução :"; lbl_DiasDevol.AutoSize = true; lbl_DiasDevol.Location = new Point(25, 220); this.Controls.Add(lbl_DiasDevol); rtxt_NomeCliente = new RichTextBox(); rtxt_NomeCliente.SelectionFont = new Font("verdana", 10, FontStyle.Bold); rtxt_NomeCliente.SelectionColor = System.Drawing.Color.Black; rtxt_NomeCliente.Location = new Point(160, 100); rtxt_NomeCliente.Size = new Size(310, 20); this.Controls.Add(rtxt_NomeCliente); num_DataNascDia = new NumericUpDown(); num_DataNascDia.Location = new Point(160, 140); num_DataNascDia.Size = new Size(60, 20); num_DataNascDia.Minimum = 1; num_DataNascDia.Maximum = 31; this.Controls.Add(num_DataNascDia); num_DataNascMes = new NumericUpDown(); num_DataNascMes.Location = new Point(200, 140); num_DataNascMes.Size = new Size(60, 20); num_DataNascMes.Minimum = 1; num_DataNascMes.Maximum = 12; this.Controls.Add(num_DataNascMes); num_DataNascAno = new NumericUpDown(); num_DataNascAno.Location = new Point(290, 140); num_DataNascAno.Size = new Size(50, 20); num_DataNascAno.Minimum = 1930; num_DataNascAno.Maximum = 2020; this.Controls.Add(num_DataNascAno); mtxt_CpfCLiente = new MaskedTextBox(); mtxt_CpfCLiente.Location = new Point(160, 180); mtxt_CpfCLiente.Size = new Size(160, 20); mtxt_CpfCLiente.Mask = "000,000,000-00"; this.Controls.Add(mtxt_CpfCLiente); cb_DiasDevol = new ComboBox(); cb_DiasDevol.Items.Add("2 Dias"); cb_DiasDevol.Items.Add("3 Dias"); cb_DiasDevol.Items.Add("4 Dias"); cb_DiasDevol.Items.Add("5 Dias"); cb_DiasDevol.AutoCompleteMode = AutoCompleteMode.Append; cb_DiasDevol.Location = new Point(160, 220); cb_DiasDevol.Size = new Size(180, 20); this.Controls.Add(cb_DiasDevol); btn_Confirmar = new Button(); btn_Confirmar.Text = "CONFIRMAR"; btn_Confirmar.Location = new Point(90, 280); btn_Confirmar.Size = new Size(160, 40); this.btn_Confirmar.BackColor = ColorTranslator.FromHtml("#9a8d7d"); this.btn_Confirmar.ForeColor = Color.Black; btn_Confirmar.Click += new EventHandler(this.btn_ConfirmarClick); this.Controls.Add(btn_Confirmar); btn_Cancelar = new Button(); btn_Cancelar.Text = "CANCELAR"; btn_Cancelar.Location = new Point(280, 280); btn_Cancelar.Size = new Size(160, 40); this.btn_Cancelar.BackColor = ColorTranslator.FromHtml("#9a8d7d"); this.btn_Cancelar.ForeColor = Color.Black; btn_Cancelar.Click += new EventHandler(this.btn_CancelarClick); this.Controls.Add(btn_Cancelar); }
private void InitializeComponent() { SuspendLayout(); lblPriority = new Label(); lblPriority.Text = "lblPriority"; lblStartDate = new Label(); lblStartDate.Text = "lblStartDate"; lblStopDate = new Label(); lblStopDate.Text = "lblStopDate"; lblGoal = new Label(); lblGoal.Text = "lblGoal"; btnGoalSelect = new Button(); btnGoalSelect.Size = new Size(26, 26); btnGoalSelect.Click += btnGoalSelect_Click; btnGoalSelect.Image = Bitmap.FromResource("Resources.btn_rec_new.gif"); txtPriority = new ComboBox(); txtPriority.ReadOnly = true; txtStartDate = new MaskedTextBox(); txtStartDate.Provider = new FixedMaskedTextProvider("00/00/0000"); txtStopDate = new MaskedTextBox(); txtStopDate.Provider = new FixedMaskedTextProvider("00/00/0000"); cmbGoalType = new ComboBox(); cmbGoalType.ReadOnly = true; cmbGoalType.SelectedIndexChanged += cmbGoalType_SelectedIndexChanged; txtGoal = new TextBox(); txtGoal.ReadOnly = true; GroupBox1 = new GroupBox(); GroupBox1.Content = new DefTableLayout { Rows = { new TableRow { Cells = { lblGoal, cmbGoalType, TableLayout.Horizontal(10,new TableCell(txtGoal, true), btnGoalSelect) } }, new TableRow { Cells = { lblPriority, txtPriority, TableLayout.Horizontal(10,lblStartDate, txtStartDate, lblStopDate, txtStopDate) } } } }; // pageNotes = new TabPage(); pageNotes.Text = "pageNotes"; tabsData = new TabControl(); tabsData.Pages.Add(pageNotes); tabsData.Size = new Size(600, 260); btnAccept = new Button(); btnAccept.ImagePosition = ButtonImagePosition.Left; btnAccept.Size = new Size(130, 26); btnAccept.Text = "btnAccept"; btnAccept.Click += btnAccept_Click; btnAccept.Image = Bitmap.FromResource("Resources.btn_accept.gif"); btnCancel = new Button(); btnCancel.ImagePosition = ButtonImagePosition.Left; btnCancel.Size = new Size(130, 26); btnCancel.Text = "btnCancel"; btnCancel.Click += btnCancel_Click; btnCancel.Image = Bitmap.FromResource("Resources.btn_cancel.gif"); Content = new DefTableLayout { Rows = { new TableRow { Cells = { GroupBox1} }, new TableRow { ScaleHeight = true, Cells = { tabsData } }, UIHelper.MakeDialogFooter(null, btnAccept, btnCancel) } }; DefaultButton = btnAccept; AbortButton = btnCancel; Title = "TaskEditDlg"; SetPredefProperties(680, 500); ResumeLayout(); }
private static int CompareTabIndex(MaskedTextBox c1, MaskedTextBox c2) { return(c1.TabIndex.CompareTo(c2.TabIndex)); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CacheOptions)); this.label1 = new System.Windows.Forms.Label(); this.enableCache = new System.Windows.Forms.CheckBox(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.label3 = new System.Windows.Forms.Label(); this.maxViolationCountMaskedTextBox = new System.Windows.Forms.MaskedTextBox(); this.label2 = new System.Windows.Forms.Label(); this.cultureComboBox = new System.Windows.Forms.ComboBox(); this.violationsAsErrorsCheckBox = new System.Windows.Forms.CheckBox(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.neededToMakeLastRowFill = new System.Windows.Forms.Panel(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // label1 resources.ApplyResources(this.label1, "label1"); this.tableLayoutPanel1.SetColumnSpan(this.label1, 3); this.label1.Name = "label1"; // enableCache resources.ApplyResources(this.enableCache, "enableCache"); this.tableLayoutPanel1.SetColumnSpan(this.enableCache, 3); this.enableCache.Name = "enableCache"; this.enableCache.UseVisualStyleBackColor = true; this.enableCache.CheckedChanged += new System.EventHandler(this.EnableCacheCheckedChanged); // label3 resources.ApplyResources(this.label3, "label3"); this.tableLayoutPanel1.SetColumnSpan(this.label3, 2); this.label3.Name = "label3"; // maxViolationCountMaskedTextBox this.maxViolationCountMaskedTextBox.AllowPromptAsInput = false; this.maxViolationCountMaskedTextBox.CausesValidation = false; this.maxViolationCountMaskedTextBox.CutCopyMaskFormat = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals; resources.ApplyResources(this.maxViolationCountMaskedTextBox, "maxViolationCountMaskedTextBox"); this.maxViolationCountMaskedTextBox.Name = "maxViolationCountMaskedTextBox"; this.maxViolationCountMaskedTextBox.RejectInputOnFirstFailure = true; this.maxViolationCountMaskedTextBox.ResetOnPrompt = false; this.maxViolationCountMaskedTextBox.ResetOnSpace = false; this.maxViolationCountMaskedTextBox.TextMaskFormat = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals; this.maxViolationCountMaskedTextBox.TextChanged += new System.EventHandler(this.MaxViolationCountTextBoxTextChanged); this.maxViolationCountMaskedTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MaxViolationCountMaskedTextBoxKeyDown); // label2 resources.ApplyResources(this.label2, "label2"); this.label2.Name = "label2"; // cultureComboBox this.tableLayoutPanel1.SetColumnSpan(this.cultureComboBox, 2); this.cultureComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cultureComboBox.FormattingEnabled = true; resources.ApplyResources(this.cultureComboBox, "cultureComboBox"); this.cultureComboBox.Name = "cultureComboBox"; this.cultureComboBox.SelectedIndexChanged += new System.EventHandler(this.CultureComboBoxSelectedIndexChanged); // violationsAsErrorsCheckBox resources.ApplyResources(this.violationsAsErrorsCheckBox, "violationsAsErrorsCheckBox"); this.tableLayoutPanel1.SetColumnSpan(this.violationsAsErrorsCheckBox, 3); this.violationsAsErrorsCheckBox.Name = "violationsAsErrorsCheckBox"; this.violationsAsErrorsCheckBox.UseVisualStyleBackColor = true; this.violationsAsErrorsCheckBox.CheckedChanged += new System.EventHandler(this.ViolationsAsErrorsCheckBoxCheckedChanged); // tableLayoutPanel1 resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); this.tableLayoutPanel1.Controls.Add(this.maxViolationCountMaskedTextBox, 2, 4); this.tableLayoutPanel1.Controls.Add(this.label2, 0, 5); this.tableLayoutPanel1.Controls.Add(this.label3, 0, 4); this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0); this.tableLayoutPanel1.Controls.Add(this.enableCache, 0, 1); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 2); this.tableLayoutPanel1.Controls.Add(this.cultureComboBox, 1, 5); this.tableLayoutPanel1.Controls.Add(this.violationsAsErrorsCheckBox, 0, 3); this.tableLayoutPanel1.Controls.Add(this.neededToMakeLastRowFill, 0, 6); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; // tableLayoutPanel2 resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); this.tableLayoutPanel1.SetColumnSpan(this.tableLayoutPanel2, 3); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; // neededToMakeLastRowFill this.tableLayoutPanel1.SetColumnSpan(this.neededToMakeLastRowFill, 3); resources.ApplyResources(this.neededToMakeLastRowFill, "neededToMakeLastRowFill"); this.neededToMakeLastRowFill.Name = "neededToMakeLastRowFill"; // CacheOptions resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.Controls.Add(this.tableLayoutPanel1); this.MinimumSize = new System.Drawing.Size(123, 40); this.Name = "CacheOptions"; this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); this.ResumeLayout(false); }
public UpdateCollectorScreen(Screen backScreen) : base("Update Collector", backScreen, 1, 2, 3) { #region Init Screen this.Dock = DockStyle.Fill; this.ColumnCount = 1; this.RowCount = 3; this.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 45F)); this.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 45F)); this.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); this.ParentChanged += UpdateCollectorScreen_ParentChanged; #endregion #region Collector Panel TableLayoutPanel tlpCollector = new TableLayoutPanel(); tlpCollector.Dock = DockStyle.Fill; tlpCollector.BackColor = Color.White; tlpCollector.Margin = new Padding(0, 10, 0, 20); tlpCollector.ColumnCount = 2; tlpCollector.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 45F)); tlpCollector.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 55F)); tlpCollector.RowCount = 8; tlpCollector.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); tlpCollector.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); tlpCollector.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); tlpCollector.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); tlpCollector.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); tlpCollector.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); tlpCollector.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); tlpCollector.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); Label lblCollectorIdPrompt = new Label(); lblCollectorIdPrompt.Text = "Collector ID:"; lblCollectorIdPrompt.Dock = DockStyle.None; lblCollectorIdPrompt.Anchor = AnchorStyles.Right; lblCollectorIdPrompt.TextAlign = ContentAlignment.MiddleRight; lblCollectorIdPrompt.AutoSize = true; //lblCollectorIdPrompt.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); tlpCollector.Controls.Add(lblCollectorIdPrompt, 0, 1); nudCollectorId = new NumericUpDown(); nudCollectorId.Anchor = AnchorStyles.Left; //nudCollectorIdInput.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); nudCollectorId.Width = 150; nudCollectorId.ValueChanged += NudCollectorIdInput_ValueChanged; tlpCollector.Controls.Add(nudCollectorId, 1, 1); Label lblFirstNamePrompt = new Label(); lblFirstNamePrompt.Text = "First Name:"; lblFirstNamePrompt.Dock = DockStyle.None; lblFirstNamePrompt.Anchor = AnchorStyles.Right; lblFirstNamePrompt.TextAlign = ContentAlignment.MiddleRight; lblFirstNamePrompt.AutoSize = true; //lblFirstNamePrompt.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); tlpCollector.Controls.Add(lblFirstNamePrompt, 0, 2); txtFirstName = new TextBox(); txtFirstName.Anchor = AnchorStyles.Left; //txtFirstNameInput.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); txtFirstName.Width = 150; txtFirstName.MaxLength = DBControlHelper.MaximumFirstNameLength; tlpCollector.Controls.Add(txtFirstName, 1, 2); Label lblLastNamePrompt = new Label(); lblLastNamePrompt.Text = "Last Name:"; lblLastNamePrompt.Dock = DockStyle.None; lblLastNamePrompt.Anchor = AnchorStyles.Right; lblLastNamePrompt.TextAlign = ContentAlignment.MiddleRight; lblLastNamePrompt.AutoSize = true; //lblLastNamePrompt.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); tlpCollector.Controls.Add(lblLastNamePrompt, 0, 3); txtLastName = new TextBox(); txtLastName.Anchor = AnchorStyles.Left; //txtLastNameInput.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); txtLastName.Width = 150; txtLastName.MaxLength = DBControlHelper.MaximumLastNameLength; tlpCollector.Controls.Add(txtLastName, 1, 3); Label lblPhoneNumberPrompt = new Label(); lblPhoneNumberPrompt.Text = "Phone Number:"; lblPhoneNumberPrompt.Dock = DockStyle.None; lblPhoneNumberPrompt.Anchor = AnchorStyles.Right; lblPhoneNumberPrompt.TextAlign = ContentAlignment.MiddleRight; lblPhoneNumberPrompt.AutoSize = true; //lblPhoneNumberPrompt.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); tlpCollector.Controls.Add(lblPhoneNumberPrompt, 0, 4); mtxtPhoneNumber = new MaskedTextBox(); mtxtPhoneNumber.Anchor = AnchorStyles.Left; mtxtPhoneNumber.Width = 150; mtxtPhoneNumber.Mask = "(000) 000-0000"; mtxtPhoneNumber.TabIndex = 5; mtxtPhoneNumber.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals; //mtxtPhoneNumberInput.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); tlpCollector.Controls.Add(mtxtPhoneNumber, 1, 4); Label lblTypePrompt = new Label(); lblTypePrompt.Text = "Type:"; lblTypePrompt.Dock = DockStyle.None; lblTypePrompt.Anchor = AnchorStyles.Right; lblTypePrompt.TextAlign = ContentAlignment.MiddleRight; lblTypePrompt.AutoSize = true; //lblTypePrompt.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); tlpCollector.Controls.Add(lblTypePrompt, 0, 5); cbxType = new ComboBox(); cbxType.Anchor = AnchorStyles.Left; //cbxTypeInput.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); cbxType.Width = 150; cbxType.DataSource = DBCollectorType.GetCollectorTypes(); cbxType.DisplayMember = "Name"; cbxType.ValueMember = "ID"; cbxType.DropDownStyle = ComboBoxStyle.DropDownList; tlpCollector.Controls.Add(cbxType, 1, 5); #endregion #region Interests Panel //Holds the "interests" title, and all the different types of tag selections TableLayoutPanel tlpInterests = new TableLayoutPanel(); tlpInterests.Dock = DockStyle.Fill; tlpInterests.BackColor = Screen.PrimaryColor; tlpInterests.ColumnCount = 3; tlpInterests.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3F)); tlpInterests.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3F)); tlpInterests.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3F)); tlpInterests.RowCount = 2; tlpInterests.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); tlpInterests.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); tlpInterests.Margin = new Padding(0, 0, 0, 10); //The main title Label lblInterestsTitle = new Label(); lblInterestsTitle.Text = "Interests"; //lblInterestsTitle.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblInterestsTitle.Margin = new Padding(0, 0, 0, 25); lblInterestsTitle.Dock = DockStyle.None; lblInterestsTitle.TextAlign = ContentAlignment.MiddleCenter; lblInterestsTitle.Anchor = AnchorStyles.Left | AnchorStyles.Right; #region Book Tags Panel //The main panel holding both the tags selection and the title TableLayoutPanel tlpTagBookPanel = new TableLayoutPanel(); tlpTagBookPanel.Dock = DockStyle.Fill; tlpTagBookPanel.BackColor = Color.White; tlpTagBookPanel.ColumnCount = 1; tlpTagBookPanel.RowCount = 2; tlpTagBookPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); tlpTagBookPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); //The title above the tag selection Label lblTagsTypeTitle = new Label(); lblTagsTypeTitle.Text = "Books"; //lblTagsTypeTitle.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblTagsTypeTitle.Dock = DockStyle.Fill; lblTagsTypeTitle.Anchor = AnchorStyles.Left & AnchorStyles.Right; //The panel holding the tags to select from tlpTagsBookSelection = new TableLayoutPanel(); tlpTagsBookSelection.Dock = DockStyle.Fill; tlpTagsBookSelection.ColumnCount = 2; tlpTagsBookSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); tlpTagsBookSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); //tagsPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.8F)); //tagsPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.8F)); //tagsPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.8F)); tlpTagsBookSelection.BackColor = Color.White; tlpTagsBookSelection.Margin = new Padding(10, 10, 10, 10); tlpTagsBookSelection.AutoScroll = true; //DBControlHelper.PopulateWithControls<DBTag, CheckBox>(tlpTagsBookSelection, DBTag.getTags(), "Description", "ID", DBCollector.getInterestsOfType((int)nudCollectorId.Value, 1)); //Add the controls to the parent panel tlpTagBookPanel.Controls.Add(lblTagsTypeTitle, 0, 0); tlpTagBookPanel.Controls.Add(tlpTagsBookSelection, 0, 1); #endregion #region Periodicals Tags Panel //The main panel holding both the tags selection and the title TableLayoutPanel tlpTagPeriodicalPanel = new TableLayoutPanel(); tlpTagPeriodicalPanel.Dock = DockStyle.Fill; tlpTagPeriodicalPanel.BackColor = Color.White; tlpTagPeriodicalPanel.ColumnCount = 1; tlpTagPeriodicalPanel.RowCount = 2; tlpTagPeriodicalPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); tlpTagPeriodicalPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); //The title above the tag selection Label lblTagsPeriodicalTitle = new Label(); lblTagsPeriodicalTitle.Text = "Periodicals"; //lblTagsPeriodicalTitle.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblTagsPeriodicalTitle.Dock = DockStyle.Fill; lblTagsPeriodicalTitle.Anchor = AnchorStyles.Left & AnchorStyles.Right; //The panel holding the tags to select from tlpTagsPeriodicalSelection = new TableLayoutPanel(); tlpTagsPeriodicalSelection.Dock = DockStyle.Fill; tlpTagsPeriodicalSelection.ColumnCount = 2; tlpTagsPeriodicalSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); tlpTagsPeriodicalSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); //tagsPeriodicalSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.8F)); //tagsPeriodicalSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.8F)); //tagsPeriodicalSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.8F)); tlpTagsPeriodicalSelection.BackColor = Color.White; tlpTagsPeriodicalSelection.Margin = new Padding(10, 10, 10, 10); tlpTagsPeriodicalSelection.AutoScroll = true; //DBControlHelper.PopulateWithControls<DBTag, CheckBox>(tlpTagsPeriodicalSelection, DBTag.getTags(), "Description", "ID", DBCollector.getInterestsOfType((int)nudCollectorId.Value, 3)); //Add the controls to the parent panel tlpTagPeriodicalPanel.Controls.Add(lblTagsPeriodicalTitle, 0, 0); tlpTagPeriodicalPanel.Controls.Add(tlpTagsPeriodicalSelection, 0, 1); #endregion #region Maps Tags Panel //The main panel holding both the tags selection and the title TableLayoutPanel tlpTagMapPanel = new TableLayoutPanel(); tlpTagMapPanel.Dock = DockStyle.Fill; tlpTagMapPanel.BackColor = Color.White; tlpTagMapPanel.ColumnCount = 1; tlpTagMapPanel.RowCount = 2; tlpTagMapPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize)); tlpTagMapPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); //The title above the tag selection Label lblTagsMapTitle = new Label(); lblTagsMapTitle.Text = "Maps"; //lblTagsMapTitle.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblTagsMapTitle.Dock = DockStyle.Fill; lblTagsMapTitle.Anchor = AnchorStyles.Left & AnchorStyles.Right; //The panel holding the tags to select from tlpTagsMapSelection = new TableLayoutPanel(); tlpTagsMapSelection.Dock = DockStyle.Fill; tlpTagsMapSelection.ColumnCount = 2; tlpTagsMapSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); tlpTagsMapSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); //tagsMapSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.8F)); //tagsMapSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.8F)); //tagsMapSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.8F)); tlpTagsMapSelection.BackColor = Color.White; tlpTagsMapSelection.Margin = new Padding(10, 10, 10, 10); tlpTagsMapSelection.AutoScroll = true; //DBControlHelper.PopulateWithControls<DBTag, CheckBox>(tlpTagsMapSelection, DBTag.getTags(), "Description", "ID", DBCollector.getInterestsOfType((int)nudCollectorId.Value, 2)); //Add the controls to the parent panel tlpTagMapPanel.Controls.Add(lblTagsMapTitle, 0, 0); tlpTagMapPanel.Controls.Add(tlpTagsMapSelection, 0, 1); #endregion tlpInterests.Controls.Add(lblInterestsTitle, 1, 0); //tlpInterests.SetColumnSpan(lblInterestsTitle, 3); tlpInterests.Controls.Add(tlpTagBookPanel, 0, 1); tlpInterests.Controls.Add(tlpTagPeriodicalPanel, 1, 1); tlpInterests.Controls.Add(tlpTagMapPanel, 2, 1); #endregion #region Bottom Buttons Panel TableLayoutPanel buttonPanel = new TableLayoutPanel(); buttonPanel.Dock = DockStyle.Fill; buttonPanel.ColumnCount = 2; buttonPanel.RowCount = 1; buttonPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); buttonPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); btnUpdate = new Button(); btnUpdate.Text = "Update"; btnUpdate.Dock = DockStyle.None; //btnUpdate.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); btnUpdate.Size = new Size(250, 30); btnUpdate.Anchor = AnchorStyles.Right; btnUpdate.BackColor = DefaultBackColor; btnUpdate.Click += BtnUpdate_Click; Button btnRemove = new Button(); btnRemove.Text = "Remove from Collector List"; btnRemove.Dock = DockStyle.None; //btnRemove.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); btnRemove.Size = new Size(250, 30); btnRemove.Anchor = AnchorStyles.Left; btnRemove.BackColor = DefaultBackColor; btnRemove.Click += BtnRemove_Click; buttonPanel.Controls.Add(btnUpdate, 0, 0); buttonPanel.Controls.Add(btnRemove, 1, 0); #endregion this.Controls.Add(tlpCollector, 0, 0); this.Controls.Add(tlpInterests, 0, 1); this.Controls.Add(buttonPanel, 0, 2); this.SetFontSizes(this.Controls); }
private void InitializeComponent() { SuspendLayout(); // rbAll = new RadioButton(); rbAll.Text = "rbAll"; rbAll.CheckedChanged += rgLife_CheckedChanged; rbOnlyLive = new RadioButton(rbAll); rbOnlyLive.Text = "rbOnlyLive"; rbOnlyLive.CheckedChanged += rgLife_CheckedChanged; rbOnlyDead = new RadioButton(rbAll); rbOnlyDead.Text = "rbOnlyDead"; rbOnlyDead.CheckedChanged += rgLife_CheckedChanged; rbAliveBefore = new RadioButton(rbAll); rbAliveBefore.Text = "rbAliveBefore"; rbAliveBefore.CheckedChanged += rgLife_CheckedChanged; lblAliveBefore = new Label(); lblAliveBefore.Text = "lblAliveBefore"; txtAliveBeforeDate = new MaskedTextBox(); txtAliveBeforeDate.Provider = new FixedMaskedTextProvider("00/00/0000"); txtAliveBeforeDate.Enabled = false; rgLife = new GroupBox(); rgLife.Content = new VDefStackLayout { Items = { rbAll, rbOnlyLive, rbOnlyDead, rbAliveBefore, new DefStackLayout(Orientation.Horizontal, 10, lblAliveBefore, txtAliveBeforeDate) } }; // rbSexAll = new RadioButton(); rbSexAll.Text = "rbSexAll"; rbSexMale = new RadioButton(rbSexAll); rbSexMale.Text = "rbSexMale"; rbSexFemale = new RadioButton(rbSexAll); rbSexFemale.Text = "rbSexFemale"; rgSex = new GroupBox(); rgSex.Content = new VDefStackLayout { Items = { rbSexAll, rbSexMale, rbSexFemale } }; // lblNameMask = new Label(); lblNameMask.Text = "lblNameMask"; txtName = new ComboBox(); lblPlaceMask = new Label(); lblPlaceMask.Text = "lblPlaceMask"; cmbResidence = new ComboBox(); lblGroups = new Label(); lblGroups.Text = "lblGroups"; cmbGroup = new ComboBox(); cmbGroup.ReadOnly = true; lblEventsMask = new Label(); lblEventsMask.Text = "lblEventsMask"; cmbEventVal = new ComboBox(); lblSources = new Label(); lblSources.Text = "lblSources"; cmbSource = new ComboBox(); cmbSource.ReadOnly = true; chkOnlyPatriarchs = new CheckBox(); chkOnlyPatriarchs.Text = "chkOnlyPatriarchs"; var masksPanel = new DefTableLayout() { Rows = { new TableRow { Cells = { lblNameMask, txtName } }, new TableRow { Cells = { lblPlaceMask, cmbResidence } }, new TableRow { Cells = { lblEventsMask, cmbEventVal } }, new TableRow { Cells = { lblGroups, cmbGroup } }, new TableRow { Cells = { lblSources, cmbSource } }, new TableRow { Cells = { chkOnlyPatriarchs, null } }, } }; pageSpecificFilter = new TabPage(); pageSpecificFilter.Text = "pageSpecificFilter"; pageSpecificFilter.Content = new DefTableLayout { Rows = { new TableRow { Cells = { rgSex, rgLife } }, new TableRow { Cells = { masksPanel, null } }, null } }; tabsFilters.Pages.Add(pageSpecificFilter); ResumeLayout(); }
public static uint ToUInt32(MaskedTextBox tb) { string value = tb.Text; return(Util.ToUInt32(value)); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(global::StyleCop.CacheOptions)); this.label1 = new System.Windows.Forms.Label(); this.enableCache = new System.Windows.Forms.CheckBox(); this.daysLabel = new System.Windows.Forms.Label(); this.daysMaskedTextBox = new System.Windows.Forms.MaskedTextBox(); this.panel3 = new System.Windows.Forms.Panel(); this.checkForUpdatesLabel = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.autoUpdateCheckBox = new System.Windows.Forms.CheckBox(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.label3 = new System.Windows.Forms.Label(); this.maxViolationCountMaskedTextBox = new System.Windows.Forms.MaskedTextBox(); this.label2 = new System.Windows.Forms.Label(); this.cultureComboBox = new System.Windows.Forms.ComboBox(); this.panel3.SuspendLayout(); this.SuspendLayout(); // // label1 // resources.ApplyResources(this.label1, "label1"); this.label1.Name = "label1"; // // enableCache // resources.ApplyResources(this.enableCache, "enableCache"); this.enableCache.Name = "enableCache"; this.enableCache.UseVisualStyleBackColor = true; this.enableCache.CheckedChanged += new System.EventHandler(this.EnableCacheCheckedChanged); // // daysLabel // resources.ApplyResources(this.daysLabel, "daysLabel"); this.daysLabel.Name = "daysLabel"; // // daysMaskedTextBox // this.daysMaskedTextBox.AllowPromptAsInput = false; this.daysMaskedTextBox.CausesValidation = false; this.daysMaskedTextBox.CutCopyMaskFormat = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals; resources.ApplyResources(this.daysMaskedTextBox, "daysMaskedTextBox"); this.daysMaskedTextBox.Name = "daysMaskedTextBox"; this.daysMaskedTextBox.RejectInputOnFirstFailure = true; this.daysMaskedTextBox.ResetOnPrompt = false; this.daysMaskedTextBox.ResetOnSpace = false; this.daysMaskedTextBox.TextMaskFormat = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals; this.daysMaskedTextBox.TextChanged += new System.EventHandler(this.DaysMaskedTextBoxTextChanged); this.daysMaskedTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.DaysMaskedTextBoxKeyDown); // // panel3 // resources.ApplyResources(this.panel3, "panel3"); this.panel3.Controls.Add(this.checkForUpdatesLabel); this.panel3.Controls.Add(this.daysLabel); this.panel3.Controls.Add(this.daysMaskedTextBox); this.panel3.Controls.Add(this.label5); this.panel3.Controls.Add(this.autoUpdateCheckBox); this.panel3.Name = "panel3"; // // checkForUpdatesLabel // resources.ApplyResources(this.checkForUpdatesLabel, "checkForUpdatesLabel"); this.checkForUpdatesLabel.Name = "checkForUpdatesLabel"; // // label5 // resources.ApplyResources(this.label5, "label5"); this.label5.Name = "label5"; // // autoUpdateCheckBox // resources.ApplyResources(this.autoUpdateCheckBox, "autoUpdateCheckBox"); this.autoUpdateCheckBox.Checked = true; this.autoUpdateCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; this.autoUpdateCheckBox.Name = "autoUpdateCheckBox"; this.autoUpdateCheckBox.UseVisualStyleBackColor = true; this.autoUpdateCheckBox.CheckedChanged += new System.EventHandler(this.AutoUpdateCheckBoxCheckedChanged); // // label3 // resources.ApplyResources(this.label3, "label3"); this.label3.Name = "label3"; // // maxViolationCountMaskedTextBox // this.maxViolationCountMaskedTextBox.AllowPromptAsInput = false; this.maxViolationCountMaskedTextBox.CausesValidation = false; this.maxViolationCountMaskedTextBox.CutCopyMaskFormat = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals; resources.ApplyResources(this.maxViolationCountMaskedTextBox, "maxViolationCountMaskedTextBox"); this.maxViolationCountMaskedTextBox.Name = "maxViolationCountMaskedTextBox"; this.maxViolationCountMaskedTextBox.RejectInputOnFirstFailure = true; this.maxViolationCountMaskedTextBox.ResetOnPrompt = false; this.maxViolationCountMaskedTextBox.ResetOnSpace = false; this.maxViolationCountMaskedTextBox.TextMaskFormat = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals; this.maxViolationCountMaskedTextBox.TextChanged += new System.EventHandler(this.MaxViolationCountTextBoxTextChanged); this.maxViolationCountMaskedTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MaxViolationCountMaskedTextBoxKeyDown); // // label2 // resources.ApplyResources(this.label2, "label2"); this.label2.Name = "label2"; // // cultureComboBox // this.cultureComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cultureComboBox.FormattingEnabled = true; resources.ApplyResources(this.cultureComboBox, "cultureComboBox"); this.cultureComboBox.Name = "cultureComboBox"; this.cultureComboBox.SelectedIndexChanged += new System.EventHandler(this.CultureComboBoxSelectedIndexChanged); // // CacheOptions // this.Controls.Add(this.cultureComboBox); this.Controls.Add(this.label2); this.Controls.Add(this.enableCache); this.Controls.Add(this.label3); this.Controls.Add(this.maxViolationCountMaskedTextBox); this.Controls.Add(this.panel3); this.Controls.Add(this.label1); this.MinimumSize = new System.Drawing.Size(246, 80); this.Name = "CacheOptions"; resources.ApplyResources(this, "$this"); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
private void InitializeComponent() { this.comboBox1 = new ComboBox(); this.maskedTextBox1 = new MaskedTextBox(); this.comboBox2 = new ComboBox(); this.label1 = new Label(); base.SuspendLayout(); this.comboBox1.DropDownStyle = ComboBoxStyle.DropDownList; this.comboBox1.FormattingEnabled = true; this.comboBox1.Items.AddRange(new object[] { "+", "-" }); this.comboBox1.Location = new Point(1, 1); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new Size(40, 20); this.comboBox1.TabIndex = 0; this.maskedTextBox1.Location = new Point(42, 1); this.maskedTextBox1.Mask = "999"; this.maskedTextBox1.Name = "maskedTextBox1"; this.maskedTextBox1.Size = new Size(45, 21); this.maskedTextBox1.TabIndex = 1; this.maskedTextBox1.Text = "000"; this.comboBox2.DropDownStyle = ComboBoxStyle.DropDownList; this.comboBox2.FormattingEnabled = true; this.comboBox2.Items.AddRange(new object[] { "10^4", "10^3", "10^2", "10^1", "10^0", "10^-1", "10^-2", "10^-3", "" }); this.comboBox2.Location = new Point(100, 1); this.comboBox2.Name = "comboBox2"; this.comboBox2.Size = new Size(74, 20); this.comboBox2.TabIndex = 2; this.label1.AutoSize = true; this.label1.Location = new Point(86, 4); this.label1.Name = "label1"; this.label1.Size = new Size(17, 12); this.label1.TabIndex = 3; this.label1.Text = "×"; base.AutoScaleDimensions = new SizeF(6f, 12f); base.ClientSize = new Size(175, 22); base.Controls.Add(this.maskedTextBox1); base.Controls.Add(this.comboBox2); base.Controls.Add(this.comboBox1); base.Controls.Add(this.label1); base.Name = "A2"; this.Text = "数据格式 A2"; base.ResumeLayout(false); base.PerformLayout(); }
public static void Error(string error, string texterror, MaskedTextBox Box, ToolTip toolTip1) { toolTip1.ToolTipTitle = error; toolTip1.Show(texterror, Box, 3000); }
void IPAddressInputBox_MouseUp(object sender, MouseEventArgs e) { MaskedTextBox text = (MaskedTextBox)sender; text.SelectAll(); }
private void btnBuscar_Click(object sender, EventArgs e) { MaskedTextBox mask = new MaskedTextBox(); int ncm; if (!int.TryParse(txtNcm.Text, out ncm) && ncm == null) { MessageBox.Show("somente numeros são aceitos no campo NCM"); return; } int i; if (!int.TryParse(txtncm2.Text, out i) && i == null) { MessageBox.Show("somente numeros são aceitos para complementar ncm"); return; } dataGridViewResultados.Rows.Clear(); while (boxEstado.SelectedIndex <= 30) { try { //abri o browser com selenium _______________________________________________________________ ChromeOptions options = new ChromeOptions(); options.AddArgument("--headless"); ChromeDriverService service = ChromeDriverService.CreateDefaultService(); service.HideCommandPromptWindow = true; //adicionar o service e option para não mostra o prompt e nem browser _____________________________________________________ ChromeDriver driver = new ChromeDriver(service, options); driver.Navigate().GoToUrl("http://www.econeteditora.com.br/icms_st/index.php?form%5Buf%5D=" + boxEstado.Text + "&form%5Bncm%5D=" + txtNcm.Text + "&form%5Bcest%5D=" + txtCest1.Text + "&form%5Bpalavra%5D=&acao=Buscar"); var clicar = driver.FindElement(By.TagName("input")); clicar.Click(); //LOGIM_______________________________________________________________________________ string login = ""; string senha = ""; var userInput = driver.FindElementByName("Log"); userInput.SendKeys(login); var passwordInput = driver.FindElementByName("Sen"); passwordInput.SendKeys(senha + Keys.Enter); driver.Navigate().GoToUrl("http://www.econeteditora.com.br/icms_st/index.php?form%5Buf%5D=" + boxEstado.Text + "&form%5Bncm%5D=" + txtNcm.Text + "&form%5Bcest%5D=" + txtCest1.Text + "&form%5Bpalavra%5D=&acao=Buscar"); //A BUSCA NCM ____________________________________________________________________________ if (i == 00 || i == null) { var Primerabusca = driver.FindElementByTagName("input"); Primerabusca.Click(); } else if (i > 00 && i <= 90) { var segundabusca = driver.FindElementByXPath("/html/body/table[3]/tbody/tr[3]/td[3]/input[1]"); segundabusca.Click(); } else if (i > 90 && i <= 9010) { var terceirabusca = driver.FindElementByXPath("/html/body/table[3]/tbody/tr[7]/td[3]/input[1]"); terceirabusca.Click(); } else { var quartabusca = driver.FindElementByXPath("/html/body/table[3]/tbody/tr[8]/td[3]/input[1]"); quartabusca.Click(); } #region PEGAR OS DADOS DA PAGINA ATUAL PELO XPATH tit= titulo //PEGAR OS DADOS DA PAGINA ATUAL PELO XPATH tit= titulo _________________________________________________________ var tit = ""; try { tit = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[1]/td[1]").Text; } catch { tit = "não existe"; } //----------- var mvaO = ""; try { mvaO = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[2]/td[1]").Text; } catch { mvaO = "não existe"; } //------------ var tit1 = ""; try { tit1 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[1]/td[2]").Text; } catch { tit1 = "não existe"; } //-------- var mva4 = ""; try { mva4 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[2]/td[2]").Text; } catch { mva4 = "não existe"; } //-------- var tit2 = ""; try { tit2 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[1]/td[3]").Text; } catch { tit2 = "não existe"; } //------------ var mva7 = ""; try { mva7 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[2]/td[3]").Text; } catch { mva7 = "não existe"; } //---------- var tit3 = ""; try { tit3 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[1]/td[4]").Text; } catch { tit3 = "não existe"; } //-------- var mva12 = ""; try { mva12 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[2]/td[4]").Text; } catch { mva12 = "não existe"; } //------- var tit4 = ""; try { tit4 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[1]/td[5]").Text; } catch { tit4 = "não existe"; } //------- var aliq = ""; try { aliq = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[2]/td[5]").Text; } catch { aliq = "não existe"; } //----- var tit5 = ""; try { tit5 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[1]/td[6]").Text; } catch { tit5 = "não existe"; } //---------- var fecp = ""; try { fecp = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[2]/td[6]").Text; } catch { fecp = "não existe"; } //CASO HOUVER UMA SEGUNDA LINHA ADICIONAR AQUI______________________________________________________________________ var T1 = ""; try { T1 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[3]/td[1]").Text; } catch { T1 = ""; } var T2 = ""; try { T2 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[3]/td[2]").Text; } catch { T2 = ""; } var T3 = ""; try { T3 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[3]/td[3]").Text; } catch { T3 = ""; } var T4 = ""; try { T4 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[3]/td[4]").Text; } catch { T4 = ""; } var T5 = ""; try { T5 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[3]/td[5]").Text; } catch { T5 = ""; } var T6 = ""; try { T6 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[3]/td[6]").Text; } catch { T6 = ""; } // 3 LINHA TABELA SE EXISTIR ___________________________________________________________________________ var C1 = ""; try { C1 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[4]/td[1]").Text; } catch { C1 = ""; } var C2 = ""; try { C2 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[4]/td[2]").Text; } catch { C2 = ""; } var C3 = ""; try { C3 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[4]/td[3]").Text; } catch { C3 = ""; } var C4 = ""; try { C4 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[4]/td[4]").Text; } catch { C4 = ""; } var C5 = ""; try { C5 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[4]/td[5]").Text; } catch { C5 = ""; } var C6 = ""; try { C6 = driver.FindElementByXPath("//*[@id=\"TabbedPanels1\"]/div/div[1]/table[3]/tbody/tr[4]/td[6]").Text; } catch { C6 = ""; } #endregion //Limpar e Adicionar valores na tabela__________________________________________________________________________________________________ //dataGridViewResultados.Rows.Clear(); dataGridViewResultados.Rows.Add(boxEstado.Text, tit, tit1, tit2, tit3, tit4, tit5); // dataGridViewResultados.DefaultCellStyle.BackColor = Color.Cyan; dataGridViewResultados.Rows.Add(boxEstado.Text, mvaO, mva4, mva7, mva12, aliq, fecp); dataGridViewResultados.Rows.Add(boxEstado.Text, T1, T2, T3, T4, T5, T6); dataGridViewResultados.Rows.Add(boxEstado.Text, C1, C2, C3, C4, C5, C6); driver.Close(); driver.Quit(); } catch { MessageBox.Show("É preciso colocar NCM ou CEst "); } if ((boxEstado.SelectedIndex % 3) == 0 || boxEstado.Text == "TO") { break; return; } else { boxEstado.SelectedIndex++; } } // limpar a caixa txtCest1.Clear(); txtNcm.Clear(); txtncm2.Clear(); txtncm2.Text = "00"; MessageBox.Show("Pesquisa concluida"); }
//-------------------------------------------------------------------------// private void InitializeComponent() { //----------------ALL THE OBJECTS OF THE ELEMENT------------------------ PanelElement panelElement1 = new PanelElement(); ImageElement imageElement1 = new ImageElement(); TextElement textElement1 = new TextElement(); this.tableLayoutPanel1 = new TableLayoutPanel(); this.panel1 = new Panel(); this.panel4 = new Panel(); this.pictureBox2 = new PictureBox(); this.statusStrip1 = new StatusStrip(); this.toolStripProgressBar1 = new ToolStripProgressBar(); this.panel2 = new Panel(); this._search = new PictureBox(); this._searchBox = new MaskedTextBox(); this.panel3 = new Panel(); this._exportImage = new PictureBox(); this._imageTileControl = new C1TileControl(); this.group1 = new Group(); this.tile1 = new Tile(); this.tile2 = new Tile(); this.tile3 = new Tile(); this.imagePdfDocument = new C1PdfDocument(); this.button = new Button(); //------------------------------------------------------------// //------------------- splitContainer1------------------------------------- this.splitContainer1 = new SplitContainer(); //properties splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; splitContainer1.IsSplitterFixed = true; splitContainer1.Location = new System.Drawing.Point(0, 0); splitContainer1.Margin = new System.Windows.Forms.Padding(2); splitContainer1.Name = "splitContainer1"; splitContainer1.Orientation = Orientation.Horizontal; // splitContainer1.Panel1 add control this.splitContainer1.Panel1.Controls.Add(this.tableLayoutPanel1); // splitContainer1 Panel2 this.splitContainer1.Panel2.Controls.Add(this.statusStrip1); this.splitContainer1.Panel2.Controls.Add(this.panel2); this.splitContainer1.Panel2.Controls.Add(this._searchBox); this.splitContainer1.Panel2.Controls.Add(this.panel3); this.splitContainer1.Panel2.Controls.Add(this._imageTileControl); this.splitContainer1.Size = new System.Drawing.Size(764, 749); this.splitContainer1.SplitterDistance = 40; this.splitContainer1.TabIndex = 0; // ----------------------------tableLayoutPanel1------------ this.tableLayoutPanel1.ColumnCount = 3; this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 37.5F)); this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 37.5F)); this.tableLayoutPanel1.Controls.Add(this.panel1, 1, 0); this.tableLayoutPanel1.Dock = DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(764, 40); this.tableLayoutPanel1.TabIndex = 0; //---------- panel1 // this.panel1.Controls.Add(this.panel4); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(194, 3); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(280, 34); this.panel1.TabIndex = 0; //------------------- panel4------------- this.panel4.Controls.Add(this.pictureBox2); this.panel4.Dock = System.Windows.Forms.DockStyle.Fill; this.panel4.Location = new System.Drawing.Point(0, 0); this.panel4.Name = "panel4"; this.panel4.Size = new System.Drawing.Size(280, 34); this.panel4.TabIndex = 0; // --------------------PICTURE BOX 2----------------------------------------- this.pictureBox2.Dock = DockStyle.Fill; this.pictureBox2.Image = global::ImageGalleryProject.Properties.Resources.iconimages; this.pictureBox2.Location = new System.Drawing.Point(0, 0); this.pictureBox2.Margin = new Padding(0); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(280, 34); this.pictureBox2.SizeMode = PictureBoxSizeMode.CenterImage; this.pictureBox2.TabIndex = 1; this.pictureBox2.TabStop = false; //------------------------------ statusStrip1---------------------------- this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripProgressBar1 }); this.statusStrip1.Location = new System.Drawing.Point(0, 683); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(764, 22); this.statusStrip1.TabIndex = 3; this.statusStrip1.Text = "statusStrip1"; this.statusStrip1.Visible = false; // ----------------------toolStripProgress bar---------------- this.toolStripProgressBar1.Name = "toolStripProgressBar1"; this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 16); this.toolStripProgressBar1.Style = ProgressBarStyle.Marquee; // ------------------panel2-------------------- this.panel2.Controls.Add(this._search); this.panel2.Location = new System.Drawing.Point(679, 19); this.panel2.Margin = new Padding(2, 12, 45, 12); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(31, 20); this.panel2.TabIndex = 1; //----------------------------SEARCH BTN------------------------------ this._search.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this._search.Image = global::ImageGalleryProject.Properties.Resources.searchimg; this._search.Location = new System.Drawing.Point(0, 0); this._search.Margin = new Padding(0); this._search.Name = "_search"; this._search.Size = new System.Drawing.Size(31, 20); this._search.SizeMode = PictureBoxSizeMode.Zoom; this._search.TabIndex = 0; this._search.TabStop = false; //event this._search.Click += new System.EventHandler(this._search_ClickAsync); // -----------------------------searchBox-------------------------- this._searchBox.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right))); this._searchBox.Location = new System.Drawing.Point(421, 19); this._searchBox.Name = "_searchBox"; this._searchBox.Size = new System.Drawing.Size(244, 20); this._searchBox.TabIndex = 1; this._searchBox.Text = "Search Image"; //----------------------------------- panel3----------------------- this.panel3.Controls.Add(this._exportImage); this.panel3.Location = new System.Drawing.Point(35, 19); this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(147, 29); this.panel3.TabIndex = 2; //----------------------------exportImage----------------- this._exportImage.Dock = DockStyle.Fill; this._exportImage.Image = global::ImageGalleryProject.Properties.Resources.exprt; this._exportImage.Location = new System.Drawing.Point(0, 0); this._exportImage.Margin = new Padding(0); this._exportImage.Name = "_exportImage"; this._exportImage.Size = new System.Drawing.Size(147, 29); this._exportImage.SizeMode = PictureBoxSizeMode.StretchImage; this._exportImage.TabIndex = 3; this._exportImage.TabStop = false; // events this._exportImage.Click += new System.EventHandler(this._exportImage_Click); this._exportImage.Paint += new PaintEventHandler(this._exportImage_Paint); // ------------------------------imageTileControl--------------------- this._imageTileControl.AllowChecking = true; this._imageTileControl.AllowDrop = true; this._imageTileControl.AllowRearranging = true; this._imageTileControl.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right))); this._imageTileControl.CellHeight = 78; this._imageTileControl.CellSpacing = 11; panelElement1.Alignment = System.Drawing.ContentAlignment.BottomLeft; panelElement1.Children.Add(imageElement1); panelElement1.Children.Add(textElement1); panelElement1.Margin = new Padding(10, 6, 10, 6); this._imageTileControl.DefaultTemplate.Elements.Add(panelElement1); this._imageTileControl.Groups.Add(this.group1); this._imageTileControl.Location = new System.Drawing.Point(0, -4); this._imageTileControl.Name = "_imageTileControl"; this._imageTileControl.Size = new System.Drawing.Size(764, 709); this._imageTileControl.SurfacePadding = new Padding(12, 4, 12, 4); this._imageTileControl.SwipeDistance = 20; this._imageTileControl.SwipeRearrangeDistance = 98; this._imageTileControl.TabIndex = 1; //events this._imageTileControl.TileChecked += new System.EventHandler <TileEventArgs>(this._imageTileControl_TileChecked); this._imageTileControl.TileUnchecked += new System.EventHandler <TileEventArgs>(this._imageTileControl_TileUnchecked); this._imageTileControl.Paint += new PaintEventHandler(this._imageTileControl_Paint); // group1 // this.group1.Name = "group1"; this.group1.Tiles.Add(this.tile1); this.group1.Tiles.Add(this.tile2); this.group1.Tiles.Add(this.tile3); // // tile1 // this.tile1.BackColor = System.Drawing.Color.LightCoral; this.tile1.Name = "tile1"; this.tile1.Text = "Tile 1"; // // tile2 // this.tile2.BackColor = System.Drawing.Color.Teal; this.tile2.Name = "tile2"; this.tile2.Text = "Tile 2"; // // tile3 // this.tile3.BackColor = System.Drawing.Color.SteelBlue; this.tile3.Name = "tile3"; this.tile3.Text = "Tile 3"; // ----------------imagePdfDocument-------------------- this.imagePdfDocument.DocumentInfo.Author = ""; this.imagePdfDocument.DocumentInfo.CreationDate = new System.DateTime(((long)(0))); this.imagePdfDocument.DocumentInfo.Creator = ""; this.imagePdfDocument.DocumentInfo.Keywords = ""; this.imagePdfDocument.DocumentInfo.Producer = "ComponentOne C1Pdf"; this.imagePdfDocument.DocumentInfo.Subject = ""; this.imagePdfDocument.DocumentInfo.Title = ""; this.imagePdfDocument.MaxHeaderBookmarkLevel = 0; this.imagePdfDocument.PdfVersion = "1.3"; this.imagePdfDocument.RefDC = null; this.imagePdfDocument.RotateAngle = 0F; this.imagePdfDocument.UseFastTextOut = true; this.imagePdfDocument.UseFontShaping = true; //----------- button---------- this.button.Location = new System.Drawing.Point(0, 0); this.button.Name = "button"; this.button.Size = new System.Drawing.Size(75, 23); this.button.TabIndex = 0; this.button.Text = "Search"; //------------------ ImageGallery------------------- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(764, 749); this.Controls.Add(this.splitContainer1); this.MaximumSize = new System.Drawing.Size(810, 810); this.MinimizeBox = false; this.Name = "ImageGallery"; this.ShowIcon = false; this.StartPosition = FormStartPosition.CenterParent; this.Text = "ImageGallery"; this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.Panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel4.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this._search)).EndInit(); this.panel3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this._exportImage)).EndInit(); this.ResumeLayout(false); //---------------------ADD COMPONENT TO FORM-------------------- ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.panel1.SuspendLayout(); this.panel4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.statusStrip1.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this._search)).BeginInit(); this.panel3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this._exportImage)).BeginInit(); this.SuspendLayout(); }
private void SetMaskedTextBoxSelectAll(MaskedTextBox txtbox) { txtbox.SelectAll(); }
private void SetPhoneTagLabel(string key, object tag, string name, string name_chs, string name_cht) { #region displayName 根據 locale 改變 var displayName = ""; switch (LanguageHelper.CurrentLanguageMode) { case LanguageHelper.LanguageMode.Alt1: displayName = name_chs + ":"; break; case LanguageHelper.LanguageMode.Alt2: displayName = name_cht + ":"; break; case LanguageHelper.LanguageMode.Default: default: displayName = name + ":"; break; } #endregion Control Ctrl = null; for (int i = 0; i < upCtrl.Controls.Count; i++) { Ctrl = upCtrl.Controls[i]; if (Ctrl != null && Ctrl.Name.Contains(key)) { #region typeof Label if (Ctrl.GetType().Equals(typeof(Label))) { Label lblTag = Ctrl as Label; lblTag.Text = displayName; lblTag.Visible = true; } #endregion #region typeof TextBox if (Ctrl.GetType().Equals(typeof(TextBox))) { TextBox txtTag = Ctrl as TextBox; txtTag.Tag = tag; txtTag.Visible = true; } #endregion #region typeof MaskedTextBox if (Ctrl.GetType().Equals(typeof(MaskedTextBox))) { MaskedTextBox txtTag = Ctrl as MaskedTextBox; txtTag.Tag = tag; txtTag.Visible = true; } #endregion #region typeof ComboBox if (Ctrl.GetType().Equals(typeof(ComboBox))) { ComboBox cboTag = Ctrl as ComboBox; cboTag.Tag = tag; cboTag.Visible = true; } #endregion #region typeof DateTimePicker if (Ctrl.GetType().Equals(typeof(DateTimePicker))) { DateTimePicker dtpTag = Ctrl as DateTimePicker; dtpTag.Tag = tag; dtpTag.Visible = true; } #endregion } } }
/// <summary> /// adds the controls to select the range of the number columns to the form with the appropriate binding /// </summary> /// <param name="columnNames"> The names of all of the columns </param> /// <param name="numColNames"> The names of the num columns (the rest are the date)</param> public void setupRangeSelect(string[] columnNames, string[] numColNames) { for (int entryNum = 0; entryNum < columnNames.Length; entryNum++) { SqlProperty sqlWhere; SqlSelectProperty sqlSelect = new SqlSelectProperty(); TextBoxBase txtLower; TextBoxBase txtUpper; const string kDateMaskString = "00/00/0000"; if (numColNames.Contains(columnNames[entryNum])) {//Num sqlWhere = new SqlNumWhereProperty(); txtLower = new TextBox(); txtUpper = new TextBox(); } else {//Date sqlWhere = new SqlDateWhereProperty(); txtLower = new MaskedTextBox(); txtUpper = new MaskedTextBox(); ((MaskedTextBox)txtLower).Mask = kDateMaskString; ((MaskedTextBox)txtUpper).Mask = kDateMaskString; } txtLower.Name = "txtLower" + entryNum; txtUpper.Name = "txtUpper" + entryNum; sqlWhere.columnName = columnNames[entryNum]; sqlSelect.columnName = columnNames[entryNum]; txtLower.DataBindings.Add("Text", sqlWhere, "LowerLimit"); txtUpper.DataBindings.Add("Text", sqlWhere, "UpperLimit"); CheckBox chkDisplay = new CheckBox() { Name = "chkDisplay" + entryNum, Text = "Display", Checked = true }; chkDisplay.DataBindings.Add("Checked", sqlSelect, "IsEnabled"); CheckBox chkEnabled = new CheckBox() { Name = "chkEnabled" + entryNum, Text = "Enabled" }; chkEnabled.DataBindings.Add("Checked", sqlWhere, "IsEnabled"); sqlWhereProperties.Add(sqlWhere); sqlSelectProperties.Add(sqlSelect); tblWhereSelection.RowCount++; tblWhereSelection.Controls.Add(new Label() { Text = columnNames[entryNum] }, 0, entryNum); tblWhereSelection.Controls.Add(chkDisplay, 1, entryNum); tblWhereSelection.Controls.Add(chkEnabled, 2, entryNum); tblWhereSelection.Controls.Add(txtLower, 3, entryNum); tblWhereSelection.Controls.Add(new Label() { Text = "<= " + sqlWhere.columnName + " <=" }, 4, entryNum); tblWhereSelection.Controls.Add(txtUpper, 5, entryNum); } tblWhereSelection.AutoScroll = true; }
private void TextBox_Edit(object sender, EventArgs e) { edit = (MaskedTextBox)sender; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmInitialForm)); this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components); this.mnuFile = new System.Windows.Forms.MenuItem(); this.mnuNewOrder = new System.Windows.Forms.MenuItem(); this.mnuSummary = new System.Windows.Forms.MenuItem(); this.menuSalesReport = new System.Windows.Forms.MenuItem(); this.mnuExit = new System.Windows.Forms.MenuItem(); this.mnuHelp = new System.Windows.Forms.MenuItem(); this.mnuAbout = new System.Windows.Forms.MenuItem(); this.colorDialog1 = new System.Windows.Forms.ColorDialog(); this.fontDialog1 = new System.Windows.Forms.FontDialog(); this.BTNNewOrder = new System.Windows.Forms.Button(); this.BTNViewSalesReport = new System.Windows.Forms.Button(); this.TBCode = new System.Windows.Forms.MaskedTextBox(); this.label1 = new System.Windows.Forms.Label(); this.BTNValidate = new System.Windows.Forms.Button(); this.GroupBoxEnterCode = new System.Windows.Forms.GroupBox(); this.LBLInvalidCode = new System.Windows.Forms.Label(); this.GroupBoxEnterCode.SuspendLayout(); this.SuspendLayout(); // // mainMenu1 // this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuFile, this.mnuHelp }); // // mnuFile // this.mnuFile.Index = 0; this.mnuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuNewOrder, this.mnuSummary, this.menuSalesReport, this.mnuExit }); this.mnuFile.Text = "&File"; // // mnuNewOrder // this.mnuNewOrder.Index = 0; this.mnuNewOrder.Text = "&New Order"; this.mnuNewOrder.Click += new System.EventHandler(this.mnuTransaction_Click); // // mnuSummary // this.mnuSummary.Index = 1; this.mnuSummary.Text = "&Summary"; this.mnuSummary.Click += new System.EventHandler(this.mnuSummary_Click); // // menuSalesReport // this.menuSalesReport.Index = 2; this.menuSalesReport.Text = "Sales Report"; this.menuSalesReport.Click += new System.EventHandler(this.menuSalesReport_Click); // // mnuExit // this.mnuExit.Index = 3; this.mnuExit.Text = "E&xit"; this.mnuExit.Click += new System.EventHandler(this.mnuExit_Click); // // mnuHelp // this.mnuHelp.Index = 1; this.mnuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuAbout }); this.mnuHelp.Text = "&Help"; // // mnuAbout // this.mnuAbout.Index = 0; this.mnuAbout.Text = "&About"; this.mnuAbout.Click += new System.EventHandler(this.mnuAbout_Click); // // BTNNewOrder // this.BTNNewOrder.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.BTNNewOrder.Location = new System.Drawing.Point(12, 177); this.BTNNewOrder.Name = "BTNNewOrder"; this.BTNNewOrder.Size = new System.Drawing.Size(158, 39); this.BTNNewOrder.TabIndex = 0; this.BTNNewOrder.Text = "New Order"; this.BTNNewOrder.UseVisualStyleBackColor = true; this.BTNNewOrder.Click += new System.EventHandler(this.BTNNewOrder_Click); // // BTNViewSalesReport // this.BTNViewSalesReport.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.BTNViewSalesReport.Location = new System.Drawing.Point(12, 234); this.BTNViewSalesReport.Name = "BTNViewSalesReport"; this.BTNViewSalesReport.Size = new System.Drawing.Size(158, 42); this.BTNViewSalesReport.TabIndex = 1; this.BTNViewSalesReport.Text = "View Sales Report"; this.BTNViewSalesReport.UseVisualStyleBackColor = true; this.BTNViewSalesReport.Click += new System.EventHandler(this.BTNViewSalesReport_Click); // // TBCode // this.TBCode.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.TBCode.Location = new System.Drawing.Point(35, 35); this.TBCode.Name = "TBCode"; this.TBCode.PasswordChar = '*'; this.TBCode.Size = new System.Drawing.Size(122, 24); this.TBCode.TabIndex = 3; // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(8, 13); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(182, 15); this.label1.TabIndex = 4; this.label1.Text = "Enter Your Employee Code:"; // // BTNValidate // this.BTNValidate.Location = new System.Drawing.Point(69, 68); this.BTNValidate.Name = "BTNValidate"; this.BTNValidate.Size = new System.Drawing.Size(60, 26); this.BTNValidate.TabIndex = 5; this.BTNValidate.Text = "Validate"; this.BTNValidate.UseVisualStyleBackColor = true; this.BTNValidate.Click += new System.EventHandler(this.BTNValidate_Click); // // GroupBoxEnterCode // this.GroupBoxEnterCode.Controls.Add(this.LBLInvalidCode); this.GroupBoxEnterCode.Controls.Add(this.label1); this.GroupBoxEnterCode.Controls.Add(this.TBCode); this.GroupBoxEnterCode.Controls.Add(this.BTNValidate); this.GroupBoxEnterCode.Location = new System.Drawing.Point(331, 168); this.GroupBoxEnterCode.Name = "GroupBoxEnterCode"; this.GroupBoxEnterCode.Size = new System.Drawing.Size(197, 129); this.GroupBoxEnterCode.TabIndex = 6; this.GroupBoxEnterCode.TabStop = false; // // LBLInvalidCode // this.LBLInvalidCode.AutoSize = true; this.LBLInvalidCode.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.LBLInvalidCode.ForeColor = System.Drawing.Color.Red; this.LBLInvalidCode.Location = new System.Drawing.Point(35, 105); this.LBLInvalidCode.Name = "LBLInvalidCode"; this.LBLInvalidCode.Size = new System.Drawing.Size(0, 13); this.LBLInvalidCode.TabIndex = 6; // // frmInitialForm // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); this.ClientSize = new System.Drawing.Size(856, 534); this.Controls.Add(this.GroupBoxEnterCode); this.Controls.Add(this.BTNNewOrder); this.Controls.Add(this.BTNViewSalesReport); this.MaximizeBox = false; this.Menu = this.mainMenu1; this.Name = "frmInitialForm"; this.Text = "Ice Cream Shop - Order Form"; this.Load += new System.EventHandler(this.frmInitialForm_Load); this.GroupBoxEnterCode.ResumeLayout(false); this.GroupBoxEnterCode.PerformLayout(); this.ResumeLayout(false); }
public static void FocusMsk(MaskedTextBox txt) { txt.BackColor = Color.White; txt.ForeColor = Color.Black; }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(fmUserLogin)); this.lblUserName = new Label(); this.lblPassword = new Label(); this.txtUserName = new MaskedTextBox(); this.txtPassword = new TextBox(); this.btnUserLogin = new Button(); this.ckbSaveLogIn = new CheckBox(); this.labelCountry = new Label(); this.comboBoxCountry = new ComboBox(); base.SuspendLayout(); this.lblUserName.AutoSize = true; this.lblUserName.BackColor = Color.Transparent; this.lblUserName.Font = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.lblUserName.ForeColor = Color.Black; this.lblUserName.Location = new Point(242, 27); this.lblUserName.Name = "lblUserName"; this.lblUserName.Size = new Size(110, 17); this.lblUserName.TabIndex = 0; this.lblUserName.Text = "Phone Number:"; this.lblPassword.AutoSize = true; this.lblPassword.BackColor = Color.Transparent; this.lblPassword.Font = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.lblPassword.ForeColor = Color.Black; this.lblPassword.Location = new Point(242, 73); this.lblPassword.Name = "lblPassword"; this.lblPassword.Size = new Size(78, 17); this.lblPassword.TabIndex = 1; this.lblPassword.Text = "Password:"******"Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.txtUserName.Location = new Point(358, 24); this.txtUserName.Mask = "(000) 000-0000"; this.txtUserName.Name = "txtUserName"; this.txtUserName.ResetOnSpace = false; this.txtUserName.Size = new Size(124, 25); this.txtUserName.TabIndex = 1; this.txtUserName.Click += new EventHandler(this.txtUserName_Click); this.txtPassword.Font = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.txtPassword.Location = new Point(326, 70); this.txtPassword.Name = "txtPassword"; this.txtPassword.Size = new Size(156, 25); this.txtPassword.TabIndex = 2; this.txtPassword.UseSystemPasswordChar = true; this.btnUserLogin.Font = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.btnUserLogin.Location = new Point(413, 161); this.btnUserLogin.Name = "btnUserLogin"; this.btnUserLogin.Size = new Size(69, 27); this.btnUserLogin.TabIndex = 10; this.btnUserLogin.Text = "Log In"; this.btnUserLogin.UseVisualStyleBackColor = true; this.btnUserLogin.Click += new EventHandler(this.btnUserLogin_Click); this.ckbSaveLogIn.AutoSize = true; this.ckbSaveLogIn.BackColor = Color.Transparent; this.ckbSaveLogIn.Checked = true; this.ckbSaveLogIn.CheckState = CheckState.Checked; this.ckbSaveLogIn.Font = new Font("Arial", 9.75f, FontStyle.Italic, GraphicsUnit.Point, 0); this.ckbSaveLogIn.Location = new Point(246, 166); this.ckbSaveLogIn.Name = "ckbSaveLogIn"; this.ckbSaveLogIn.Size = new Size(165, 20); this.ckbSaveLogIn.TabIndex = 20; this.ckbSaveLogIn.TabStop = false; this.ckbSaveLogIn.Text = "Save Log In Information"; this.ckbSaveLogIn.UseVisualStyleBackColor = false; this.labelCountry.AutoSize = true; this.labelCountry.BackColor = Color.Transparent; this.labelCountry.Font = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.labelCountry.ForeColor = Color.Black; this.labelCountry.Location = new Point(243, 119); this.labelCountry.Name = "labelCountry"; this.labelCountry.Size = new Size(63, 17); this.labelCountry.TabIndex = 11; this.labelCountry.Text = "Country:"; this.comboBoxCountry.DropDownStyle = ComboBoxStyle.DropDownList; this.comboBoxCountry.FlatStyle = FlatStyle.Flat; this.comboBoxCountry.Font = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.comboBoxCountry.FormattingEnabled = true; this.comboBoxCountry.Location = new Point(326, 116); this.comboBoxCountry.Name = "comboBoxCountry"; this.comboBoxCountry.Size = new Size(156, 25); this.comboBoxCountry.TabIndex = 3; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.Font; this.BackgroundImageLayout = ImageLayout.Stretch; base.ClientSize = new Size(498, 200); base.Controls.Add(this.comboBoxCountry); base.Controls.Add(this.labelCountry); base.Controls.Add(this.ckbSaveLogIn); base.Controls.Add(this.btnUserLogin); base.Controls.Add(this.txtPassword); base.Controls.Add(this.txtUserName); base.Controls.Add(this.lblPassword); base.Controls.Add(this.lblUserName); base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon"); base.KeyPreview = true; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "fmUserLogin"; base.StartPosition = FormStartPosition.CenterScreen; this.Text = "Log In"; base.Load += new EventHandler(this.fmUserLogin_Load); base.ResumeLayout(false); base.PerformLayout(); }
private bool KTNgay(MaskedTextBox txtNgay) { string a = txtNgay.Text; int ngay, thang, nam; try { ngay = int.Parse(a.Substring(0, 2).Trim()); } catch { Mark(0, 2, txtNgay); return(false); } if (ngay > 31 || ngay <= 0) { Mark(0, 2, txtNgay); return(false); } try { thang = int.Parse(a.Substring(3, 2).Trim()); } catch { Mark(3, 2, txtNgay); return(false); } if (thang > 12 || thang <= 0) { Mark(3, 2, txtNgay); return(false); } else { if ((thang == 4 || thang == 6 || thang == 9 || thang == 11) && ngay > 30) { Mark(0, 2, txtNgay); return(false); } else if (thang == 2 && ngay > 29) { Mark(0, 2, txtNgay); return(false); } } try { nam = int.Parse(a.Substring(6, 4)); } catch { Mark(6, 4, txtNgay); return(false); } if (nam % 4 != 0 && nam % 100 != 0 && nam % 400 != 0 && ngay > 28 && thang == 2) { Mark(0, 2, txtNgay); return(false); } return(true); }
public void LoadConfig() { if (!EasyServer.InitConfig("Configs/Conf.xml", "Config")) { return; } Config = EasyServer.GetConf("Config"); foreach (KeyValuePair <string, ConfigElement> Elements in Config.Children) { ConfigElement Element = Elements.Value; Log.Info("Control", "New control : " + Elements.Key); if (Elements.Key == "Master") { string Name = Element["Name"].GetString("Launcher"); int W = Element["Width"].GetInt(100); int H = Element["Height"].GetInt(100); int Resize = Element["Resize"].GetInt(100); Log.Info("Scale", "X=" + W + ",Y=" + H); this.Name = Name; this.Text = Name; this.AutoScaleDimensions = new SizeF(W, H); this.AutoScaleMode = AutoScaleMode.Font; this.FormBorderStyle = Resize <= 0 ? FormBorderStyle.FixedToolWindow : FormBorderStyle.Sizable; this.ClientSize = new Size(Width, Height); this.Size = new System.Drawing.Size(W, H); } else { string Type = Element["Type"].GetString("label"); string Name = Element["Name"].GetString("Unknown"); string Text = Element["Text"].GetString(""); int W = Element["Width"].GetInt(100); int H = Element["Height"].GetInt(20); int X = Element["X"].GetInt(0); int Y = Element["Y"].GetInt(0); int Transparency = Element["Tranparency"].GetInt(0); string Tag = Element["Tag"].GetString(""); string[] BackColor = Element["BackColor"].GetString("1,1,1").Split(','); string[] ForeColor = Element["ForeColor"].GetString("255,255,255").Split(','); Log.Info("Tag", "Tag=" + Tag); Control Con; switch (Type) { case "textArea": int Masked = Element["Masked"].GetInt(0); if (Masked == 0) { Con = new TextBox(); } else { Con = new MaskedTextBox(); } if (Transparency > 0) { (Con as TextBoxBase).BorderStyle = BorderStyle.None; } break; case "Label": Con = new Label(); break; case "button": Con = new Button(); Con.Click += new EventHandler(this.OnClick); break; case "picture": Con = new PictureBox(); (Con as PictureBox).ImageLocation = Element["Image"].GetString(); (Con as PictureBox).InitialImage = null; break; default: Con = new Label(); break; } Con.Name = Name; Con.Text = Text; Con.Location = new System.Drawing.Point(X, Y); Con.Size = new System.Drawing.Size(W, H); if (Con is Label) { (Con as Label).AutoSize = true; } Con.Tag = Tag; if (BackColor.Length >= 3) { Con.BackColor = Color.FromArgb(int.Parse(BackColor[0]), int.Parse(BackColor[1]), int.Parse(BackColor[2])); } if (ForeColor.Length >= 3) { Con.ForeColor = Color.FromArgb(int.Parse(ForeColor[0]), int.Parse(ForeColor[1]), int.Parse(ForeColor[2])); } _Controls.Add(Con); } } }
private void Mark(int start, int lenght, MaskedTextBox txtDay) { txtDay.Focus(); txtDay.Select(start, lenght); }
public ItemPanel(InventoryItem Item, PictureBox Pic, ComboBox Name, CheckBox Equipped, NumericUpDown Forges, NumericUpDown Charges, MaskedTextBox Raw) { this.Pic = Pic; this.Name = Name; this.Equipped = Equipped; this.Forges = Forges; this.Charges = Charges; this.Raw = Raw; this.ItemDb = Data.Database.Items; this.item = Item; Name.ValueMember = "ItemID"; Name.DisplayMember = "DisplayName"; Name.DataSource = ItemDb.GetAll() .Where((x) => (x.Type != ItemType.Unknown) || x.ItemID == Enums.Item.None) .OrderBy((x) => x.DisplayName) .ToList(); }
private void InitializeComponent() { Spacing = 14; Button photoButton = new Button(); photoButton.Width = 93; photoButton.Height = 93; photoButton.ImagePosition = ButtonImagePosition.Overlay; photoButton.Click += OnPhotoButtonClicked; if (File.Exists(_user.Photo)) { Bitmap buffer = new Bitmap(_user.Photo); int width = photoButton.Width - 14; int height = photoButton.Height - 14; photoButton.Image = new Bitmap(buffer, width, height, ImageInterpolation.High); } else { photoButton.Image = Bitmap.FromResource("user"); } StackLayout column0 = new StackLayout(); column0.Items.Add(photoButton); Label nameLabel = new Label(); nameLabel.Text = "Name"; NameBox = new TextBox(); NameBox.Width = 250; NameBox.Text = _user.Name; Label organizationLabel = new Label(); organizationLabel.Text = "Organization"; OrganizationBox = new TextBox(); OrganizationBox.Width = 250; OrganizationBox.Text = _user.Organization; Label emailLabel = new Label(); emailLabel.Text = "E-Mail"; EmailBox = new MaskedTextBox(); EmailBox.Width = 250; EmailBox.Text = _user.EmailAddress; StackLayout column1 = new StackLayout(); column1.Spacing = 7; column1.Items.Add(nameLabel); column1.Items.Add(NameBox); column1.Items.Add(organizationLabel); column1.Items.Add(OrganizationBox); column1.Items.Add(emailLabel); column1.Items.Add(EmailBox); Orientation = Orientation.Horizontal; Spacing = 14; Items.Add(column0); Items.Add(column1); }
private void InitializeComponent() { ComponentResourceManager resources = new ComponentResourceManager(typeof(Login)); this.txtUser = new System.Windows.Forms.TextBox(); this.txtPwd = new System.Windows.Forms.MaskedTextBox(); this.lnkTiago = new System.Windows.Forms.LinkLabel(); this.btnSair = new System.Windows.Forms.Button(); this.btnEntrar = new System.Windows.Forms.Button(); this.lblVersao = new System.Windows.Forms.Label(); this.SuspendLayout(); // // txtUser // this.txtUser.AutoCompleteCustomSource.AddRange(new string[] { "Eduardo", "Tiago", "Manutencao", "Mario", "Lizane" }); this.txtUser.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append; this.txtUser.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; this.txtUser.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(186)))), ((int)(((byte)(242))))); this.txtUser.BorderStyle = System.Windows.Forms.BorderStyle.None; this.txtUser.CausesValidation = false; this.txtUser.Font = new System.Drawing.Font("Trebuchet MS", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtUser.ForeColor = System.Drawing.Color.Black; this.txtUser.Location = new System.Drawing.Point(234, 131); this.txtUser.MaxLength = 15; this.txtUser.Name = "txtUser"; this.txtUser.Size = new System.Drawing.Size(221, 19); this.txtUser.TabIndex = 0; this.txtUser.Text = "Manutencao"; this.txtUser.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // txtPwd // this.txtPwd.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(186)))), ((int)(((byte)(242))))); this.txtPwd.BorderStyle = System.Windows.Forms.BorderStyle.None; this.txtPwd.Font = new System.Drawing.Font("Trebuchet MS", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtPwd.Location = new System.Drawing.Point(234, 166); this.txtPwd.Mask = "0000"; this.txtPwd.Name = "txtPwd"; this.txtPwd.PasswordChar = '*'; this.txtPwd.PromptChar = ' '; this.txtPwd.Size = new System.Drawing.Size(221, 19); this.txtPwd.TabIndex = 1; this.txtPwd.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtPwd.TextMaskFormat = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals; this.txtPwd.Enter += new System.EventHandler(this.txtPwd_Enter); // // lnkTiago // this.lnkTiago.ActiveLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(112)))), ((int)(((byte)(141))))); this.lnkTiago.AutoSize = true; this.lnkTiago.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(149)))), ((int)(((byte)(209)))), ((int)(((byte)(245))))); this.lnkTiago.Font = new System.Drawing.Font("Trebuchet MS", 9.5F, System.Drawing.FontStyle.Bold); this.lnkTiago.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline; this.lnkTiago.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(112)))), ((int)(((byte)(141))))); this.lnkTiago.Location = new System.Drawing.Point(325, 253); this.lnkTiago.Name = "lnkTiago"; this.lnkTiago.Size = new System.Drawing.Size(118, 18); this.lnkTiago.TabIndex = 4; this.lnkTiago.TabStop = true; this.lnkTiago.Text = "Tiago Silva Miguel"; this.lnkTiago.VisitedLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(112)))), ((int)(((byte)(141))))); this.lnkTiago.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkTiago_LinkClicked); // // btnSair // this.btnSair.BackColor = System.Drawing.Color.IndianRed; this.btnSair.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnSair.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSair.Font = new System.Drawing.Font("Trebuchet MS", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnSair.ForeColor = System.Drawing.Color.Black; this.btnSair.Location = new System.Drawing.Point(193, 198); this.btnSair.Name = "btnSair"; this.btnSair.Size = new System.Drawing.Size(120, 36); this.btnSair.TabIndex = 3; this.btnSair.Text = "Fechar"; this.btnSair.UseVisualStyleBackColor = false; this.btnSair.Click += new System.EventHandler(this.btnSair_Click); // // btnEntrar // this.btnEntrar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); this.btnEntrar.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnEntrar.FlatAppearance.BorderSize = 0; this.btnEntrar.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnEntrar.Font = new System.Drawing.Font("Trebuchet MS", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnEntrar.Location = new System.Drawing.Point(336, 198); this.btnEntrar.Name = "btnEntrar"; this.btnEntrar.Size = new System.Drawing.Size(120, 36); this.btnEntrar.TabIndex = 2; this.btnEntrar.Text = "Entrar"; this.btnEntrar.UseVisualStyleBackColor = false; this.btnEntrar.Click += new System.EventHandler(this.btnEntrar_Click); // // lblVersao // this.lblVersao.AutoSize = true; this.lblVersao.BackColor = System.Drawing.Color.White; this.lblVersao.Font = new System.Drawing.Font("Trebuchet MS", 9.25F, System.Drawing.FontStyle.Bold); this.lblVersao.Location = new System.Drawing.Point(498, 9); this.lblVersao.Name = "lblVersao"; this.lblVersao.Size = new System.Drawing.Size(58, 18); this.lblVersao.TabIndex = 5; this.lblVersao.Text = "Versão: "; this.lblVersao.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // Login // this.AcceptButton = this.btnEntrar; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; this.BackgroundImage = global::Gerenciador_de_Tarefas.Properties.Resources.TelaLogin; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.CancelButton = this.btnSair; this.ClientSize = new System.Drawing.Size(637, 401); this.Controls.Add(this.lblVersao); this.Controls.Add(this.btnEntrar); this.Controls.Add(this.btnSair); this.Controls.Add(this.lnkTiago); this.Controls.Add(this.txtPwd); this.Controls.Add(this.txtUser); this.Font = new System.Drawing.Font("Trebuchet MS", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Login"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Gerenciador de Tarefas"; this.Load += new System.EventHandler(this.Login_Load); this.ResumeLayout(false); this.PerformLayout(); }
internal static uint ToUInt32(MaskedTextBox tb) { string value = tb.Text; return(ToUInt32(value)); }
/// <summary> /// Initializes the search text boxes. /// </summary> /// <param name="textBoxDefinitions">The list of text box definitions. Used to build the text box controls.</param> public void InitializeTextBoxes(IEnumerable<TextBoxDefinition> textBoxDefinitions) { this.TextBoxes = new NameValueCollection(); foreach (var args in textBoxDefinitions.Select(tbd => new TextBoxEventArgs { TextBoxDefinition = tbd })) { this.OnTextBoxCreating(args); var textBox = new MaskedTextBox { ID = TextBoxIdPrefix + args.TextBoxDefinition.Field, CssClass = args.IsWide ? "scSearch Wide" : "scSearch", Text = args.Text, MaskedText = args.TextBoxDefinition.Title, MaskedCssStyle = "scSearchLabel" }; textBox.Attributes["onkeydown"] = "javascript:if (event.keyCode == 13) { Grid.scHandler.refresh(); return false; }"; this.TextBoxContainer.Controls.Add(textBox); if (!string.IsNullOrEmpty(args.Text)) { this.TextBoxes.Add(args.TextBoxDefinition.Field, args.Text); } } }
/// <summary> /// 将MaskedTextBox控件的格式设为yyyy-mm-dd格式. /// </summary> /// <param name="NDate">日期</param> /// <param name="ID">数据表名称</param> /// <returns>返回String对象</returns> public void MaskedTextBox_Format(MaskedTextBox MTBox) { MTBox.Mask = "0000-00-00"; MTBox.ValidatingType = typeof(System.DateTime); }