public InstructionsForm () { // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Fill; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Location = new Point (8, 8); _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Expected result on start-up:{0}{0}" + "1. The background color of the Form is blue and does not show " + "any distortions.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // InstructionsForm // ClientSize = new Size (330, 120); Location = new Point (600, 100); StartPosition = FormStartPosition.Manual; Text = "Instructions - bug #81721"; }
public StringEditor(PropertyLabel label, PropertyItem property) : base(property) { if (property.PropertyType == typeof(Char)) { if ((char)property.Value == '\0') property.Value = ""; } property.PropertyChanged += property_PropertyChanged; property.ValueError += property_ValueError; textBox = new TextBox { Height = 20, Foreground = Property.CanWrite ? Brushes.Black : Brushes.Gray, BorderThickness = new Thickness(0), Margin = new Thickness(0), IsReadOnly = !Property.CanWrite }; if (null != property.Value) textBox.Text = property.Value.ToString(); if (Property.CanWrite) textBox.TextChanged += Control_TextChanged; Content = textBox; GotFocus += StringValueEditor_GotFocus; }
private HtmlGenericControl getDataLineContainer(ISetting setting) { HtmlGenericControl div_line = new HtmlGenericControl("div"); div_line.Attributes.Add("class", "control-line-of-controls"); HtmlGenericControl div_data_label = new HtmlGenericControl("div"); div_data_label.Attributes.Add("style", "padding-top: 3px; float: left; width: 200px"); div_data_label.Attributes.Add("align", "left"); div_data_label.Attributes.Add("class", "control-label"); div_data_label.InnerText = getLocalResource(setting); HtmlGenericControl div_data_input = new HtmlGenericControl("div"); div_data_input.Attributes.Add("style", "float: left; width: 360px"); TextBox box = new TextBox { Text = setting.Value.ToString() , ID = string.Format(m_objectKey, setting.SettingAttribute.SettingName) , CssClass = "control-textbox" , EnableTheming = false }; box.Attributes.Add("style", "width: 100%"); div_data_input.Controls.Add(box); div_line.Controls.Add(div_data_label); div_line.Controls.Add(div_data_input); return div_line; }
public InstructionsForm () { // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Fill; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Expected result on start-up:{0}{0}" + "1. The main form is displayed fullscreen, and has no " + "borders or titlebar.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // InstructionsForm // ClientSize = new Size (320, 100); Location = new Point (600, 100); StartPosition = FormStartPosition.Manual; Text = "Instructions - bug #349571"; TopMost = true; }
public InstructionsForm () { // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Fill; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Steps to execute:{0}{0}" + "1. Press the Alt+F4 key.{0}{0}" + "Expected result:{0}{0}" + "1. The application exits.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // InstructionsForm // ClientSize = new Size (300, 140); Location = new Point (600, 100); StartPosition = FormStartPosition.Manual; Text = "Instructions - bug #358340"; }
private void DrawCreateToonMenu() { DarkGUI.Instance.ClearAllUI(); var charName = new TextBox("charName", new Rect(XCentre - 50, YCentre, 100, 50)); var isMale = new CheckBox("isMale?", new Rect(XCentre - 50, YCentre - 50, 100, 50)); new Button("Create!", XCentre - 50, YCentre - 150).OnClick += delegate(Button sender) { _network.Send(new CreateCharacter() { Name = charName.Text, isMale = isMale.Checked }); }; }
public Interact(string title) { Control.CheckForIllegalCrossThreadCalls = true; Poke = new Button(); Poke.Text = "Poke"; this.Controls.Add(Poke); Poke.Click += new EventHandler(Input); //The adaptee includes specific details like this //for the user interface SendGift = new Button(); SendGift.Text = "Send Gift"; SendGift.Location = new Point(80, 0); this.Controls.Add(SendGift); SendGift.Click += new EventHandler(Input2); GiftText = new TextBox(); GiftText.Location = new Point(160, 0); this.Controls.Add(GiftText); //******************************************* Wall = new TextBox(); Wall.Multiline = true; Wall.Location = new Point(0, 30); Wall.Width = 300; Wall.Height = 200; Wall.Font = new Font(Wall.Font.Name, 12); Wall.AcceptsReturn = true; this.Text = title; this.Controls.Add(Wall); }
public PostageRatesTable() { lblOrigin = MakeNewTextBox(); lblDestination = MakeNewTextBox(); lblDeliveryService = MakeNewTextBox(); lblWeight = MakeNewTextBox(); lblCharges = MakeNewTextBox(); lblAvailableDays = MakeNewTextBox(); lblEstimatedDeliveryTime = MakeNewTextBox(); lblOrigin.Text = "Origin"; lblDestination.Text = "Destination"; lblDeliveryService.Text = "Delivery Service"; lblWeight.Text = "Weight"; lblCharges.Text = "Charges (20g, 50g, 100g, per additional 100g)"; lblAvailableDays.Text = "Available Days"; lblEstimatedDeliveryTime.Text = "Estimated Delivery Time"; this.Size = new Size(700, 500); this.ColumnCount = 7; this.RowCount = 0; this.CellBorderStyle = TableLayoutPanelCellBorderStyle.OutsetDouble; this.AutoSize = true; this.Controls.Add(lblOrigin); this.Controls.Add(lblDestination); this.Controls.Add(lblDeliveryService); this.Controls.Add(lblWeight); this.Controls.Add(lblCharges); this.Controls.Add(lblAvailableDays); this.Controls.Add(lblEstimatedDeliveryTime); PopulateTable(); }
//protected void chkFullance_CheckedChanged(object sender, EventArgs e) //{ // if (chkFullance.Checked) // { // foreach (GridViewRow gvr in dgrid.Rows) // { // Label lblStudID = new Label(); // lblStudID = (Label)gvr.Cells[0].FindControl("lblStaffID"); // DataSet ds1 = new DataSet(); // int month = Convert.ToInt32(ddlMonth.Items[ddlMonth.SelectedIndex].Value); // int year = Convert.ToInt32(ddlYear.Items[ddlYear.SelectedIndex].Value); // int noofWorkingdays = Convert.ToInt32(txtnoofworkingdays.Text); // TextBox txtNoOfDaysPresents = new TextBox(); // txtNoOfDaysPresents = (TextBox)gvr.Cells[2].FindControl("txtDaysPresent"); // int leavedays; // ds1 = objStaff.GetStaffAttendanceByLeaves(Convert.ToInt32(lblStudID.Text), month, year); // leavedays =Convert.ToInt32(ds1.Tables[0].Rows[0][2].ToString()); // txtNoOfDaysPresents.Text = Convert.ToString((noofWorkingdays - leavedays)); // } // } // if (chkFullance.Checked==false) // { // foreach (GridViewRow gvr in dgrid.Rows) // { // TextBox txtNoOfDaysPresents = new TextBox(); // TextBox txtnoofworkingdays = new TextBox(); // txtNoOfDaysPresents = (TextBox)gvr.Cells[2].FindControl("txtDaysPresent"); // txtNoOfDaysPresents.Text = txtnoofworkingdays.Text; // } // } //} protected void btnAttendance_Click(object sender, EventArgs e) { foreach (GridViewRow gvr in dgrid.Rows) { Label lblStudID = new Label(); lblStudID = (Label)gvr.Cells[0].FindControl("lblStaffID"); DataSet ds1 = new DataSet(); int month = Convert.ToInt32(ddlMonth.Items[ddlMonth.SelectedIndex].Value); int year = Convert.ToInt32(ddlYear.Items[ddlYear.SelectedIndex].Value); int noofWorkingdays = Convert.ToInt32(txtnoofworkingdays.Text); TextBox txtNoOfDaysPresents = new TextBox(); txtNoOfDaysPresents = (TextBox)gvr.Cells[2].FindControl("txtDaysPresent"); int leavedays; ds1 = objStaff.GetStaffAttendanceByLeaves(Convert.ToInt32(lblStudID.Text), month, year); if (ds1.Tables.Count > 0) { if (ds1.Tables[0].Rows.Count > 0) { leavedays = Convert.ToInt32(ds1.Tables[0].Rows[0][2].ToString()); txtNoOfDaysPresents.Text = Convert.ToString((noofWorkingdays - leavedays)); } else { txtNoOfDaysPresents.Text = txtnoofworkingdays.Text; } } txtNoOfDaysPresents.Enabled = false; } }
public InstructionsForm () { // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Fill; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Expected result on start-up:{0}{0}" + "1. The text \"2\" is displayed.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // InstructionsForm // ClientSize = new Size (400, 90); Location = new Point (550, 100); StartPosition = FormStartPosition.Manual; Text = "Instructions - bug #80792"; }
public InstructionsForm () { // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Fill; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Steps to execute:{0}{0}" + "1. Select an item in the combobox.{0}{0}" + "Expected result:{0}{0}" + "1. A new form is displayed.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // InstructionsForm // ClientSize = new Size (300, 150); Location = new Point (600, 100); StartPosition = FormStartPosition.Manual; Text = "Instructions - bug #352830"; }
public InstructionsForm () { // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Fill; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Steps to execute:{0}{0}" + "1. Type \"12345\" and the hit the Enter key.{0}{0}" + "Expected result:{0}{0}" + "1. The character \"3\" and the Enter key are ignored.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // InstructionsForm // ClientSize = new Size (300, 155); Location = new Point (600, 100); StartPosition = FormStartPosition.Manual; Text = "Instructions - bug #340078"; }
public async void New(TextBox display) { if (await Confirm("Create New?", "Compression App", "Yes", "No")) { display.Text = string.Empty; } }
public SimpleBinding () { text_box = new TextBox (); text_box.Left = 10; text_box.Top = 10; text_box.Width = Width - 20; next_button = new Button (); next_button.Text = "Next"; next_button.Left = Width - 10 - next_button.Width; next_button.Top = text_box.Bottom + 5; back_button = new Button (); back_button.Text = "Back"; back_button.Left = 10; back_button.Top = text_box.Bottom + 5; next_button.Click += new EventHandler (NextClick); back_button.Click += new EventHandler (BackClick); Controls.Add (text_box); Controls.Add (next_button); Controls.Add (back_button); text_box.DataBindings.Add ("Text", EmployeeList, "Name"); }
void Start() { TextBox = new TextBox(); if (Randomize == true) { int randomIndex = UnityEngine.Random.Range(0, RandomItems.Length); Type = RandomItems[randomIndex]; Quantity = 1; } temp = new Item(Type); temp.Quantity = Quantity; if (Quantity == 1) { TextBox.addText("You received " + temp.Quantity + " " + temp.Name); } else if (Quantity > 1) { TextBox.addText("You received " + temp.Quantity + " " + temp.Name + "s"); } sRenderer = GetComponent<SpriteRenderer>(); BoxColl = GetComponent<BoxCollider2D>(); Player = GameObject.FindWithTag("Player").GetComponent<PlayerControls>(); }
public override async void OnApplyTemplate() #endif { base.OnApplyTemplate(); InputBox = GetTemplateChild(InputBoxName) as TextBox; if (InputBox != null) { // manually adding // GetBindingExpression doesn't seem to respect TemplateBinding // so TextBoxBinding's code doesn't fire #if WINDOWS_STORE || WINDOWS_PHONE_APP var binding = new Windows.UI.Xaml.Data.Binding(); #elif WINDOWS_PHONE var binding = new System.Windows.Data.Binding(); #endif binding.Source = InputBox; binding.Path = new PropertyPath("Text"); SetBinding(ValueProperty, binding); TextBinding.SetUpdateSourceOnChange(InputBox, true); HookUpEventForIsSubmitOnEnterKey(); if (!ApplicationSpace.IsDesignMode) await DelayInputSelect(); } }
public MainForm () { // // _textBox // _textBox = new TextBox (); _textBox.Dock = DockStyle.Top; _textBox.Height = 100; _textBox.Multiline = true; Controls.Add (_textBox); // // _multilineCheckBox // _multilineCheckBox = new CheckBox (); _multilineCheckBox.Checked = true; _multilineCheckBox.Location = new Point (8, 110); _multilineCheckBox.Size = new Size (100, 20); _multilineCheckBox.Text = "Multiline"; _multilineCheckBox.CheckedChanged += new EventHandler (MultilineCheckBox_CheckedChanged); Controls.Add (_multilineCheckBox); // // MainForm // ClientSize = new Size (300, 135); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #82749"; Load += new EventHandler (MainForm_Load); }
public MainForm () { // // _richTextBox // _richTextBox = new RichTextBox (); _richTextBox.Dock = DockStyle.Top; _richTextBox.Height = 120; Controls.Add (_richTextBox); // // _textBox // _textBox = new TextBox (); _textBox.Dock = DockStyle.Bottom; _textBox.Height = 120; _textBox.Multiline = true; Controls.Add (_textBox); // // MainForm // ClientSize = new Size (300, 250); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #81682"; Load += new EventHandler (MainForm_Load); }
public InstructionsForm () { // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Fill; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Expected result on start-up:{0}{0}" + "1. The form icon and the text \"My Computer\" are " + "displayed as content of the first panel in the " + "StatusBar.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // InstructionsForm // ClientSize = new Size (300, 100); Location = new Point (600, 100); StartPosition = FormStartPosition.Manual; Text = "Instructions - bug #82487"; }
public InstructionsForm () { // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Fill; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Expected result on start-up:{0}{0}" + "1. A window measuring 400x600 pixels is displayed at {{X=100,Y=100}}.{0}{0}" + "2. The background is possibly messed-up.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // InstructionsForm // ClientSize = new Size (400, 120); Location = new Point (550, 100); StartPosition = FormStartPosition.Manual; Text = "Instructions - bug #80817"; }
public MyForm() { lblMessage = new Label(); btnOK = new Button(); btnCancel = new Button(); txtInput = new TextBox(); Text = "Hello World"; ClientSize = new System.Drawing.Size(200, 125); lblMessage.Location = new System.Drawing.Point(15, 20); lblMessage.Size = new System.Drawing.Size(175, 24); lblMessage.Text = ""; txtInput.Location = new System.Drawing.Point(15, 50); txtInput.Size = new System.Drawing.Size(175, 24); txtInput.Text = ""; btnOK.Location = new System.Drawing.Point(30, 85); btnOK.Size = new System.Drawing.Size(60, 30); btnOK.Text = "&OK"; btnOK.Click += new System.EventHandler(btnOK_Click); btnCancel.Location = new System.Drawing.Point(120, 85); btnCancel.Size = new System.Drawing.Size(60, 30); btnCancel.Text = "&Cancel"; btnCancel.Click += new System.EventHandler(btnCancel_Click); Controls.Add(lblMessage); Controls.Add(btnOK); Controls.Add(txtInput); Controls.Add(btnCancel); }
public SimpleText(int i) : base(i) { base.InputElementName = "SimpleText"; tbValue = new TextBox(); tbLabel = new TextBox(); }
public MainForm () { // // _tableLayoutPanel // _tableLayoutPanel = new TableLayoutPanel (); _tableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; _tableLayoutPanel.ColumnCount = 3; _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle ()); _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle ()); _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle ()); _tableLayoutPanel.Dock = DockStyle.Fill; _tableLayoutPanel.RowCount = 2; _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Percent, 50F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Percent, 50F)); Controls.Add (_tableLayoutPanel); // // _buttonA // _buttonA = new Button (); _buttonA.TabIndex = 1; _buttonA.Text = "Button A"; _buttonA.UseVisualStyleBackColor = true; _tableLayoutPanel.Controls.Add (_buttonA, 0, 1); // // _buttonB // _buttonB = new Button (); _buttonB.TabIndex = 4; _buttonB.Text = "Button B"; _buttonB.UseVisualStyleBackColor = true; _tableLayoutPanel.Controls.Add (_buttonB, 2, 1); // // _label // _label = new Label (); _label.AutoSize = true; _label.Dock = DockStyle.Fill; _label.TabIndex = 6; _label.Text = "Label"; _tableLayoutPanel.Controls.Add (_label, 1, 1); // // _textBox // _textBox = new TextBox (); _textBox.Dock = DockStyle.Fill; _textBox.Multiline = true; _textBox.TabIndex = 7; _tableLayoutPanel.Controls.Add (_textBox, 1, 0); // // MainForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (292, 300); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #81843"; Load += new EventHandler (MainForm_Load); }
public InstructionsForm () { // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Fill; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Expected result on startup:{0}{0}" + "1. A star-like shape is drawn.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // InstructionsForm // ClientSize = new Size (310, 100); Location = new Point (600, 100); StartPosition = FormStartPosition.Manual; Text = "Instructions - bug #338233"; }
protected void Page_Load(object sender, EventArgs e) { List<Event> events = Event.GetAllEvents(); foreach (Event selectedEvent in events) { Panel pnlEvent = new Panel(); pnlEvent.ID = selectedEvent.ID.ToString(); pnlEvent.Attributes.Add("class", "panel"); CheckBox chkbxEventName = new CheckBox(); chkbxEventName.ID = "chkbx" + selectedEvent.Name; chkbxEventName.Text = selectedEvent.Name; pnlEvent.Controls.Add(chkbxEventName); for (int i = 0; i < selectedEvent.MaxTeamSize; i++) { TextBox txtbxTTID = new TextBox(); txtbxTTID.ID = "TTID" + (i + 1).ToString() + selectedEvent.ID; txtbxTTID.Attributes.Add("placeholder", "TTID " + (i + 1).ToString()); txtbxTTID.Attributes.Add("style", "display:none;"); pnlEvent.Controls.Add(txtbxTTID); RegularExpressionValidator rev = new RegularExpressionValidator(); rev.ControlToValidate = txtbxTTID.ClientID; rev.Attributes.Add("style", "display:none;"); rev.ValidationExpression = "\\d{4}"; rev.ErrorMessage = "*"; pnlEvent.Controls.Add(rev); } pnlEvents.Controls.Add(pnlEvent); } }
// 动态创建控件 // 注意:这段代码需要每次加载页面都执行,因此不能放在 if(!IsPostBack) 逻辑判断中 protected void Page_Init(object sender, EventArgs e) { // 创建一个 FormRow 控件并添加到 Form2 FormRow row = new FormRow(); row.ID = "rowUser"; Form2.Rows.Add(row); TextBox tbxUser = new TextBox(); tbxUser.ID = "tbxUserName"; tbxUser.Text = ""; tbxUser.Label = "用户名"; tbxUser.ShowLabel = true; tbxUser.ShowRedStar = true; tbxUser.Required = true; row.Items.Add(tbxUser); DropDownList ddlGender = new DropDownList(); ddlGender.ID = "ddlGender"; ddlGender.Label = "性别(自动回发)"; ddlGender.Items.Add("男", "0"); ddlGender.Items.Add("女", "1"); ddlGender.SelectedIndex = 0; ddlGender.AutoPostBack = true; ddlGender.SelectedIndexChanged += new EventHandler(ddlGender_SelectedIndexChanged); row.Items.Add(ddlGender); }
public InstructionsForm () { // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Fill; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Steps to execute:{0}{0}" + "1. Click the Invalidate button twice.{0}{0}" + "Expected result:{0}{0}" + "1. The color of the ellipse changes on each click.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // InstructionsForm // ClientSize = new Size (300, 140); Location = new Point (600, 100); StartPosition = FormStartPosition.Manual; Text = "Instructions - bug #82838"; }
public MainForm () { // // _comboBox // _comboBox = new ComboBox (); _comboBox.DisplayMember = "displaymember"; _comboBox.Location = new Point (8, 8); _comboBox.Size = new Size (150, 20); _comboBox.ValueMember = "valuemember"; Controls.Add (_comboBox); // // _selectedValueText // _selectedValueText = new TextBox (); _selectedValueText.Location = new Point (8, 40); _selectedValueText.Size = new Size (150, 20); _selectedValueText.Text = ""; Controls.Add (_selectedValueText); // // MainForm // ClientSize = new Size (170, 75); Location = new Point (400, 100); StartPosition = FormStartPosition.Manual; Text = "bug #81611"; Load += new EventHandler (MainForm_Load); }
public ChatBox() { Size = new Point(100, 100); Input = new TextBox(); Input.Size = new Point(100, 35); Input.Dock = DockStyle.Bottom; Input.TextCommit += Input_OnTextCommit; Elements.Add(Input); Scrollbar = new ScrollBar(); Scrollbar.Dock = DockStyle.Right; Scrollbar.Size = new Point(25, 25); Elements.Add(Scrollbar); Frame = new Frame(); Frame.Dock = DockStyle.Fill; Frame.Scissor = true; Elements.Add(Frame); Output = new Label(); Output.BBCodeEnabled = true; Output.TextWrap = true; Output.AutoSize = Squid.AutoSize.Vertical; Output.Text = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."; Output.Style = "multiline"; Frame.Controls.Add(Output); }
// Use this for initialization void Start () { textComponent = textbox.GetComponent<TextBox>(); textComponent.setText("I AM BOSS DOG PET ALL OF ME"); animator = dog.GetComponent<Animator> (); endActive = false; barsDone = 0; }
private void FillTableSingleSku(string sku, OleDbConnection cnn) { AddFirstRow(); TableRow tr; TableCell tc; Label labSku; HiddenField hidSku; TextBox txCodMaga; //TextBox txTipoR; DropDownList dropTipoR; CheckBox chklav; TextBox txQtS; CheckBox chkMCS; DropDownList dropVett; ImageButton imgB; DataTable vettori = UtilityMaietta.Vettore.GetVettori(cnn); ArrayList risposte = AmazonOrder.Comunicazione.GetAllRisposte(amzSettings.amzComunicazioniFile, aMerchant); int count = 0; { tr = new TableRow(); //SKU tc = new TableCell(); labSku = new Label(); labSku.ID = "labSku#" + sku + "#si" + count.ToString(); labSku.Text = sku; hidSku = new HiddenField(); hidSku.ID = "hidSku#" + sku + "#si" + count.ToString(); hidSku.Value = sku; tc.Controls.Add(labSku); tc.Controls.Add(hidSku); tr.Cells.Add(tc); //CODICE MAGA tc = new TableCell(); txCodMaga = new TextBox(); txCodMaga.ID = "txCodMaga#" + sku; txCodMaga.Text = (AmazonOrder.SKUItem.SkuExistsMaFra(cnn, sku) ? sku.ToUpper() : ""); tc.Controls.Add(txCodMaga); tr.Cells.Add(tc); //TIPO RISPOSTA tc = new TableCell(); dropTipoR = new DropDownList(); dropTipoR.ID = "dropTpr#" + sku; dropTipoR.Width = 160; dropTipoR.DataSource = risposte; dropTipoR.DataTextField = "nome"; dropTipoR.DataValueField = "id"; dropTipoR.DataBind(); tc.Controls.Add(dropTipoR); /*txTipoR = new TextBox(); * txTipoR.ID = "txTpr#" + oi.sellerSKU; * txTipoR.Width = 30; * tc.Controls.Add(txTipoR);*/ tr.Cells.Add(tc); //LAVORAZIONE tc = new TableCell(); chklav = new CheckBox(); chklav.ID = "chkLav#" + sku; tc.Controls.Add(chklav); tr.Cells.Add(tc); //QT SCARICARE tc = new TableCell(); txQtS = new TextBox(); txQtS.ID = "txQtS#" + sku; txQtS.Width = 30; tc.Controls.Add(txQtS); tr.Cells.Add(tc); //OFFERTA tc = new TableCell(); chkMCS = new CheckBox(); chkMCS.ID = "chkMCS#" + sku; tc.Controls.Add(chkMCS); tr.Cells.Add(tc); //VETTORE tc = new TableCell(); dropVett = new DropDownList(); dropVett.ID = "dropVett#" + sku; dropVett.DataSource = vettori; dropVett.DataTextField = "sigla"; dropVett.DataValueField = "id"; dropVett.DataBind(); dropVett.SelectedValue = amzSettings.amzDefVettoreID.ToString(); tc.Controls.Add(dropVett); tr.Cells.Add(tc); // AGGIUNGI RIGA tc = new TableCell(); imgB = new ImageButton(); imgB.ID = "add_" + sku; imgB.ImageUrl = "pics/add.png"; imgB.Width = 35; imgB.Height = 35; imgB.OnClientClick = "return addRow(this);"; tc.Controls.Add(imgB); tr.Cells.Add(tc); if ((count % 2) != 0) { tr.BackColor = System.Drawing.Color.LightGray; } tabCodes.Rows.Add(tr); count++; } }
/// <summary> /// constructor for author conatins name /// </summary> /// <param name="name"></param> public Author(TextBox name) { _name = name; }
public UITraceListener(TextBox output) { base.Name = "Trace"; this.output = output; }
/// <summary> /// デザイナ サポートに必要なメソッドです。このメソッドの内容を /// コード エディタで変更しないでください。 /// </summary> private void InitializeComponent() { this._nameLabel = new System.Windows.Forms.Label(); this._nameBox = new TextBox(); this._valueLabel = new System.Windows.Forms.Label(); this._valueBox = new TextBox(); this._okButton = new System.Windows.Forms.Button(); this._cancelButton = new System.Windows.Forms.Button(); this.SuspendLayout(); // // _nameLabel // this._nameLabel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this._nameLabel.Location = new System.Drawing.Point(8, 8); this._nameLabel.Name = "_nameLabel"; this._nameLabel.Size = new System.Drawing.Size(56, 16); this._nameLabel.TabIndex = 0; // // _nameBox // this._nameBox.Location = new System.Drawing.Point(72, 8); this._nameBox.Name = "_nameBox"; this._nameBox.Size = new System.Drawing.Size(216, 19); this._nameBox.TabIndex = 1; this._nameBox.Text = ""; // // _valueLabel // this._valueLabel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this._valueLabel.Location = new System.Drawing.Point(8, 32); this._valueLabel.Name = "_valueLabel"; this._valueLabel.Size = new System.Drawing.Size(56, 16); this._valueLabel.TabIndex = 2; // // _valueBox // this._valueBox.Location = new System.Drawing.Point(72, 32); this._valueBox.Name = "_valueBox"; this._valueBox.Size = new System.Drawing.Size(216, 19); this._valueBox.TabIndex = 3; this._valueBox.Text = ""; // // _okButton // this._okButton.DialogResult = System.Windows.Forms.DialogResult.OK; this._okButton.Location = new System.Drawing.Point(136, 64); this._okButton.Name = "_okButton"; this._okButton.FlatStyle = FlatStyle.System; this._okButton.TabIndex = 4; this._okButton.Click += new EventHandler(OnOK); // // _cancelButton // this._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this._cancelButton.Location = new System.Drawing.Point(216, 64); this._cancelButton.Name = "_cancelButton"; this._cancelButton.FlatStyle = FlatStyle.System; this._cancelButton.TabIndex = 5; // // EditEnvVariable // this.AcceptButton = this._okButton; this.AutoScaleBaseSize = new System.Drawing.Size(5, 12); this.CancelButton = this._cancelButton; this.ClientSize = new System.Drawing.Size(292, 93); this.Controls.AddRange(new System.Windows.Forms.Control[] { this._cancelButton, this._okButton, this._valueBox, this._valueLabel, this._nameBox, this._nameLabel }); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "EditEnvVariable"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.ResumeLayout(false); }
protected void RptPerson_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Good") { int id = Convert.ToInt32(e.CommandArgument.ToString()); string sql = "select good from Dynamic where id='" + id + "'"; DataTable dt = new DataTable(); dt = mysay.select(sql); int good = Convert.ToInt32(dt.Rows[0][0].ToString()); good += 1; string sql1 = "update Dynamic set good='" + good + "' where id='" + id + "'"; //判断是否点过赞 string sql2 = "select state from Dynamic where id='" + id + "'"; DataTable dt2 = mysay.select(sql2); string str = dt2.Rows[0][0].ToString(); string str1 = Session["name"].ToString(); if (str.Contains(str1)) { Response.Write("<script>alert('你已经点过赞了!')</script>"); } else { mysay.store_change(sql1); str = str + str1 + ','; string sql3 = "update Dynamic set state='" + str + "' where id='" + id + "'"; mysay.store_change(sql3); } Response.Write("<script>window.location='Say.aspx'</script>"); } if (e.CommandName == "Reply") { int id = Convert.ToInt32(e.CommandArgument.ToString()); TextBox reply2 = (TextBox)e.Item.FindControl("reply"); string rp = reply2.Text; string sql = "insert into Dynamic_comment values('" + id + "','" + Session["name"].ToString() + "','" + Session["nickname"].ToString() + "','" + rp + "','say_comment','" + DateTime.Now.ToString() + "')"; mysay.store_change(sql); mysay.rank(Session["name"].ToString(), 1); Response.Write("<script>window.location='Say.aspx'</script>"); } if (e.CommandName == "Delete") { int id = Convert.ToInt32(e.CommandArgument.ToString()); string sql = "delete from Dynamic where id='" + id + "'"; mysay.store_change(sql); Response.Write("<script>window.location='Say.aspx'</script>"); } if (e.CommandName == "Collect") { int id = Convert.ToInt32(e.CommandArgument.ToString()); string sql1 = "select * from Dynamic where id= '" + id + "'"; DataTable dt = mysay.select(sql1); string sql3 = "select * from Collection_dynamic where say='" + dt.Rows[0][4].ToString() + "' and myusername='******' and title='" + dt.Rows[0][5].ToString() + "'and dairy='" + dt.Rows[0][6].ToString() + "'and album='" + dt.Rows[0][7].ToString() + "' and photo='" + dt.Rows[0][8].ToString() + "'and printdairy='" + dt.Rows[0][9].ToString() + "' and printphoto='" + dt.Rows[0][10].ToString() + "'"; DataTable dt1 = mysay.select(sql3); //之前没收藏过 if (dt1.Rows.Count == 0) { string sql2 = "insert into Collection_dynamic values('" + Session["name"].ToString() + "','" + dt.Rows[0][1].ToString() + "','" + dt.Rows[0][4].ToString() + "','" + dt.Rows[0][5].ToString() + "','" + dt.Rows[0][6].ToString() + "','" + dt.Rows[0][7].ToString() + "','" + dt.Rows[0][8].ToString() + "','" + dt.Rows[0][9].ToString() + "','" + dt.Rows[0][10].ToString() + "')"; mysay.store_change(sql2); Response.Write("<script>alert('收藏成功!');location='Homepage.aspx'</script>"); } else { Response.Write("<script>alert('不可重复收藏!')</script>"); } } if (e.CommandName == "Friendspace") { Session["tourist"] = e.CommandArgument.ToString(); string sql = "select nickname from Login where username='******'"; DataTable dt = mysay.select(sql); Session["touristnickname"] = dt.Rows[0][0].ToString(); string sql1 = "select * from Authority where username='******' and otherusername='******'"; int a = mysay.visit(sql1, Session["tourist"].ToString(), Session["touristnickname"].ToString(), Session["name"].ToString(), Session["nickname"].ToString()); if (a == 1) { Response.Write("<script>window.location='Homepage.aspx'</script>"); } else { Session["tourist"] = null; Session["touristnickname"] = null; Response.Write("<script>alert('你没有访问权限!')</script>"); } } }
private void FillTableCodes(AmazonOrder.Order o, OleDbConnection cnn) { AddFirstRow(); TableRow tr; TableCell tc; Label labSku; HiddenField hidSku; TextBox txCodMaga; //TextBox txTipoR; DropDownList dropTipoR; CheckBox chklav; TextBox txQtS; CheckBox chkMCS; DropDownList dropVett; ImageButton imgB; DataTable vettori = UtilityMaietta.Vettore.GetVettori(cnn); ArrayList risposte = AmazonOrder.Comunicazione.GetAllRisposte(amzSettings.amzComunicazioniFile, aMerchant); int count = 0; foreach (AmazonOrder.OrderItem oi in o.Items) { if (oi.prodotti == null || oi.prodotti.Count == 0) // QUESTO ITEM HA SKU DA INSERIRE { tr = new TableRow(); //SKU tc = new TableCell(); labSku = new Label(); labSku.ID = "labSku#" + oi.sellerSKU + "#si" + count.ToString(); labSku.Text = oi.sellerSKU; hidSku = new HiddenField(); hidSku.ID = "hidSku#" + oi.sellerSKU + "#si" + count.ToString(); hidSku.Value = oi.sellerSKU; tc.Controls.Add(labSku); tc.Controls.Add(hidSku); tr.Cells.Add(tc); //CODICE MAGA tc = new TableCell(); txCodMaga = new TextBox(); txCodMaga.ID = "txCodMaga#" + oi.sellerSKU; txCodMaga.Text = (AmazonOrder.SKUItem.SkuExistsMaFra(cnn, oi.sellerSKU) ? oi.sellerSKU.ToUpper() : ""); tc.Controls.Add(txCodMaga); tr.Cells.Add(tc); //TIPO RISPOSTA tc = new TableCell(); dropTipoR = new DropDownList(); dropTipoR.ID = "dropTpr#" + oi.sellerSKU; dropTipoR.Width = 160; dropTipoR.DataSource = risposte; dropTipoR.DataTextField = "nome"; dropTipoR.DataValueField = "id"; dropTipoR.DataBind(); tc.Controls.Add(dropTipoR); /*txTipoR = new TextBox(); * txTipoR.ID = "txTpr#" + oi.sellerSKU; * txTipoR.Width = 30; * tc.Controls.Add(txTipoR);*/ tr.Cells.Add(tc); //LAVORAZIONE tc = new TableCell(); chklav = new CheckBox(); chklav.ID = "chkLav#" + oi.sellerSKU; tc.Controls.Add(chklav); tr.Cells.Add(tc); //QT SCARICARE tc = new TableCell(); txQtS = new TextBox(); txQtS.ID = "txQtS#" + oi.sellerSKU; txQtS.Width = 30; tc.Controls.Add(txQtS); tr.Cells.Add(tc); //OFFERTA tc = new TableCell(); chkMCS = new CheckBox(); chkMCS.ID = "chkMCS#" + oi.sellerSKU; tc.Controls.Add(chkMCS); tr.Cells.Add(tc); //VETTORE tc = new TableCell(); dropVett = new DropDownList(); dropVett.ID = "dropVett#" + oi.sellerSKU; dropVett.DataSource = vettori; dropVett.DataTextField = "sigla"; dropVett.DataValueField = "id"; dropVett.DataBind(); dropVett.SelectedValue = amzSettings.amzDefVettoreID.ToString(); tc.Controls.Add(dropVett); tr.Cells.Add(tc); // AGGIUNGI RIGA tc = new TableCell(); imgB = new ImageButton(); imgB.ID = "add_" + oi.sellerSKU; imgB.ImageUrl = "pics/add.png"; imgB.Width = 35; imgB.Height = 35; imgB.OnClientClick = "return addRow(this);"; tc.Controls.Add(imgB); tr.Cells.Add(tc); if ((count % 2) != 0) { tr.BackColor = System.Drawing.Color.LightGray; } tabCodes.Rows.Add(tr); count++; } else { foreach (AmazonOrder.SKUItem si in oi.prodotti) // QUESTO ITEM E' GIA' MEMORIZZATO { tr = new TableRow(); //SKU tc = new TableCell(); labSku = new Label(); labSku.ID = "labSku#" + oi.sellerSKU + "#si" + count.ToString(); labSku.Text = "@@" + si.SKU; hidSku = new HiddenField(); hidSku.ID = "hidSku#@@" + si.SKU + "#si" + count.ToString(); hidSku.Value = "@@" + oi.sellerSKU; tc.Controls.Add(labSku); tc.Controls.Add(hidSku); tr.Cells.Add(tc); //CODICE MAGA tc = new TableCell(); tc.Text = si.prodotto.codmaietta; tr.Cells.Add(tc); //TIPO RISPOSTA tc = new TableCell(); tc.Text = si.idrisposta.ToString(); tr.Cells.Add(tc); //LAVORAZIONE tc = new TableCell(); chklav = new CheckBox(); chklav.ID = "chkLav#" + oi.sellerSKU; chklav.Checked = si.lavorazione; chklav.Enabled = false; tc.Controls.Add(chklav); tr.Cells.Add(tc); //QT SCARICARE tc = new TableCell(); tc.Text = si.qtscaricare.ToString(); tr.Cells.Add(tc); //OFFERTA tc = new TableCell(); chkMCS = new CheckBox(); chkMCS.ID = "chkMCS#" + oi.sellerSKU; chkMCS.Checked = si.isMCS; chkMCS.Enabled = false; tc.Controls.Add(chkMCS); tr.Cells.Add(tc); //VETTORE tc = new TableCell(); dropVett = new DropDownList(); dropVett.ID = "dropVett#" + oi.sellerSKU; dropVett.DataSource = vettori; dropVett.DataTextField = "sigla"; dropVett.DataValueField = "id"; dropVett.DataBind(); dropVett.SelectedValue = amzSettings.amzDefVettoreID.ToString(); tc.Controls.Add(dropVett); tr.Cells.Add(tc); if ((count % 2) != 0) { tr.BackColor = System.Drawing.Color.LightGray; } tabCodes.Rows.Add(tr); count++; } } } }
private void FillTableSKU(ArrayList items, OleDbConnection cnn) { AddFirstRow(); TableRow tr; TableCell tc; Label labSku; Label labCodMaie; HiddenField hidSku; HiddenField hidCodMaie; TextBox txCodMaga; //TextBox txTipoR; DropDownList dropTipoR; CheckBox chklav; TextBox txQtS; CheckBox chkMCS; ImageButton imgB; DropDownList dropVett; DataTable vettori = UtilityMaietta.Vettore.GetVettori(cnn); ArrayList risposte = AmazonOrder.Comunicazione.GetAllRisposte(amzSettings.amzComunicazioniFile, aMerchant); AmazonOrder.Comunicazione com; int count = 0; foreach (AmazonOrder.SKUItem si in items) { tr = new TableRow(); //SKU tc = new TableCell(); labSku = new Label(); labSku.ID = "labSku#" + si.SKU; labSku.Text = si.SKU; hidSku = new HiddenField(); hidSku.ID = "hidSku#" + si.SKU; hidSku.Value = si.SKU; tc.Controls.Add(labSku); tc.Controls.Add(hidSku); tr.Cells.Add(tc); //CODICE MAGA tc = new TableCell(); if (si.MovimentazioneChecked && 0 == 1) // GIA MOVIMENTATO METTO LABEL { labCodMaie = new Label(); labCodMaie.ID = "labCodMaga#" + si.SKU; labCodMaie.Text = si.prodotto.codmaietta; tc.Controls.Add(labCodMaie); hidCodMaie = new HiddenField(); hidCodMaie.ID = "hidCodMaie#" + si.SKU + "#si" + count; hidCodMaie.Value = si.prodotto.codmaietta; tc.Controls.Add(hidCodMaie); } else { txCodMaga = new TextBox(); txCodMaga.ID = "txCodMaga#" + si.SKU + "#si" + count; txCodMaga.Text = si.prodotto.codmaietta; tc.Controls.Add(txCodMaga); } tr.Cells.Add(tc); //TIPO RISPOSTA tc = new TableCell(); dropTipoR = new DropDownList(); dropTipoR.ID = "dropTpr#" + si.SKU + "#si" + count; dropTipoR.Width = 160; dropTipoR.DataSource = risposte; dropTipoR.DataTextField = "nome"; dropTipoR.DataValueField = "id"; dropTipoR.DataBind(); com = new AmazonOrder.Comunicazione(si.idrisposta, amzSettings, aMerchant); dropTipoR.SelectedIndex = com.Index(risposte); tc.Controls.Add(dropTipoR); /*txTipoR = new TextBox(); * txTipoR.ID = "txTpr#" + si.SKU + "#si" + count; * txTipoR.Width = 30; * txTipoR.Text = si.idrisposta.ToString(); * tc.Controls.Add(txTipoR);*/ tr.Cells.Add(tc); //LAVORAZIONE tc = new TableCell(); chklav = new CheckBox(); chklav.ID = "chkLav#" + si.SKU + "#si" + count; chklav.Checked = si.lavorazione; tc.Controls.Add(chklav); tr.Cells.Add(tc); //QT SCARICARE tc = new TableCell(); txQtS = new TextBox(); txQtS.ID = "txQtS#" + si.SKU + "#si" + count; txQtS.Width = 30; txQtS.Text = si.qtscaricare.ToString(); tc.Controls.Add(txQtS); tr.Cells.Add(tc); //OFFERTA tc = new TableCell(); chkMCS = new CheckBox(); chkMCS.ID = "chkMCS#" + si.SKU + "#si" + count; chkMCS.Checked = si.isMCS; tc.Controls.Add(chkMCS); tr.Cells.Add(tc); //VETTORE tc = new TableCell(); dropVett = new DropDownList(); dropVett.ID = "dropVett#" + si.SKU + "#si" + count; dropVett.DataSource = vettori; dropVett.DataTextField = "sigla"; dropVett.DataValueField = "id"; dropVett.DataBind(); dropVett.SelectedValue = si.vettoreID.ToString(); tc.Controls.Add(dropVett); tr.Cells.Add(tc); // AGGIUNGI RIGA tc = new TableCell(); if (!si.MovimentazioneChecked) { imgB = new ImageButton(); imgB.ID = "add_" + si.SKU; imgB.ImageUrl = "pics/add.png"; imgB.Width = 35; imgB.Height = 35; imgB.OnClientClick = "return addRow(this);"; tc.Controls.Add(imgB); } tr.Cells.Add(tc); if (si.MovimentazioneChecked) // PRODOTTO CON MOVIMENTAZIONI { tr.BackColor = System.Drawing.ColorTranslator.FromHtml("#FF9882"); } else if ((count % 2) != 0) { tr.BackColor = System.Drawing.Color.LightGray; } tabCodes.Rows.Add(tr); count++; } }
/// <summary> /// Clears any error being displayed by the error provider for the specified textbox. /// </summary> /// <param name="textBox">The textbox which should be cleared from errors flags.</param> private void ClearError(TextBox textBox) { this.errorProvider1.SetError(textBox, string.Empty); }
/// <summary> /// Creates a parameter and tries to add it into the Structure. /// </summary> /// <param name="paramNumber">Ordinal number of the parameter 'like 1st, 2nd, etc.'</param> /// <param name="aStructure">Structure to add the parameter.</param> /// <param name="chBox">Check box of the parameter.</param> /// <param name="cmbType">Combo Box of the parameter.</param> /// <param name="txtName">TextBox of the parameter's name.</param> /// <param name="txtLength">TextBox of the parameter's Length.</param> private void CreateParameterFromForm(string paramNumber, Structure aStructure, CheckBox chBox, ComboBox cmbType, TextBox txtName, TextBox txtLength) { if (chBox.Checked) { Parameter aParameter = new Parameter(); if (!String.IsNullOrWhiteSpace(txtName.Text) && !String.IsNullOrWhiteSpace(txtLength.Text)) { aParameter = CreateParameter(aStructure, aParameter, txtName.Text, cmbType.SelectedItem.ToString(), txtLength.Text); if (!(aStructure + aParameter)) { MessageBox.Show($"An Error has occurred adding the {paramNumber} parameter: {aParameter.NameParameter}!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { this.textBoxes.Add(txtName); if (cmbType.SelectedItem.ToString().Equals("char")) { this.textChars.Add(txtLength); } } } else { throw new EmptyFieldException("You have at least one field Empty."); } } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormCentralChooseDatabase)); this.groupServer = new System.Windows.Forms.GroupBox(); this.textURI = new System.Windows.Forms.TextBox(); this.textUser2 = new System.Windows.Forms.TextBox(); this.textPassword2 = new System.Windows.Forms.TextBox(); this.label10 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.butCancel = new OpenDental.UI.Button(); this.butOK = new OpenDental.UI.Button(); this.groupServer.SuspendLayout(); this.SuspendLayout(); // // groupServer // this.groupServer.Controls.Add(this.textURI); this.groupServer.Controls.Add(this.textUser2); this.groupServer.Controls.Add(this.textPassword2); this.groupServer.Controls.Add(this.label10); this.groupServer.Controls.Add(this.label11); this.groupServer.Controls.Add(this.label9); this.groupServer.Controls.Add(this.label6); this.groupServer.Location = new System.Drawing.Point(12, 12); this.groupServer.Name = "groupServer"; this.groupServer.Size = new System.Drawing.Size(336, 182); this.groupServer.TabIndex = 2; this.groupServer.TabStop = false; this.groupServer.Text = "Connect to Middle Tier"; // // textURI // this.textURI.Location = new System.Drawing.Point(13, 65); this.textURI.Name = "textURI"; this.textURI.Size = new System.Drawing.Size(309, 20); this.textURI.TabIndex = 7; // // textUser2 // this.textUser2.Location = new System.Drawing.Point(13, 108); this.textUser2.Name = "textUser2"; this.textUser2.Size = new System.Drawing.Size(309, 20); this.textUser2.TabIndex = 8; // // textPassword2 // this.textPassword2.Location = new System.Drawing.Point(13, 149); this.textPassword2.Name = "textPassword2"; this.textPassword2.PasswordChar = '*'; this.textPassword2.Size = new System.Drawing.Size(309, 20); this.textPassword2.TabIndex = 9; this.textPassword2.UseSystemPasswordChar = true; // // label10 // this.label10.Location = new System.Drawing.Point(11, 130); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(281, 18); this.label10.TabIndex = 11; this.label10.Text = "Password"; this.label10.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // label11 // this.label11.Location = new System.Drawing.Point(11, 89); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(295, 18); this.label11.TabIndex = 14; this.label11.Text = "Open Dental User (not MySQL user)"; this.label11.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // label9 // this.label9.Location = new System.Drawing.Point(10, 44); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(283, 18); this.label9.TabIndex = 9; this.label9.Text = "URI"; this.label9.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // label6 // this.label6.Location = new System.Drawing.Point(9, 25); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(297, 18); this.label6.TabIndex = 0; this.label6.Text = "Read the manual to learn how to install the middle tier."; // // butCancel // this.butCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.butCancel.Location = new System.Drawing.Point(273, 201); this.butCancel.Name = "butCancel"; this.butCancel.Size = new System.Drawing.Size(75, 24); this.butCancel.TabIndex = 13; this.butCancel.Text = "&Cancel"; this.butCancel.Click += new System.EventHandler(this.butCancel_Click); // // butOK // this.butOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.butOK.Location = new System.Drawing.Point(192, 201); this.butOK.Name = "butOK"; this.butOK.Size = new System.Drawing.Size(75, 24); this.butOK.TabIndex = 12; this.butOK.Text = "&OK"; this.butOK.Click += new System.EventHandler(this.butOK_Click); // // FormCentralChooseDatabase // this.AcceptButton = this.butOK; this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(360, 238); this.Controls.Add(this.groupServer); this.Controls.Add(this.butCancel); this.Controls.Add(this.butOK); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "FormCentralChooseDatabase"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Choose Database"; this.groupServer.ResumeLayout(false); this.groupServer.PerformLayout(); this.ResumeLayout(false); }
public static void pull(String srcPath, String destPath, TextBox textBox) { WinCmd.cmd("adb " + "pull " + srcPath + " " + destPath, textBox); }
private void InitializeComponent() { CheckAdmin(IsRunAsAdmin()); components = new Container(); _txtPath = new TextBox(); _btnBrwDic = new Button(); _fbdSelect = new FolderBrowserDialog(); _btnRefresh = new Button(); _btnFlash = new Button(); _devicelist = new ListView(); _clnID = new ColumnHeader(); _clnDevice = new ColumnHeader(); _clnProgress = new ColumnHeader(); _clnTime = new ColumnHeader(); _clnStatus = new ColumnHeader(); _clnResult = new ColumnHeader(); _txtLog = new RichTextBox(); _timerUpdateStatus = new Timer(components); _statusStrp = new StatusStrip(); _statusLblMsg = new ToolStripStatusLabel(); _statusTab = new ToolStripStatusLabel(); _rdoCleanAll = new RadioStripItem(); _rdoSaveUserData = new RadioStripItem(); _rdoCleanAllAndLock = new RadioStripItem(); _lblMD5 = new Label(); _menuStrip1 = new MenuStrip(); _miConfiguration = new ToolStripMenuItem(); _miFlashConfigurationToolStripMenuItem = new ToolStripMenuItem(); _miInstallDrivers = new ToolStripMenuItem(); _statusStrp.SuspendLayout(); _menuStrip1.SuspendLayout(); SuspendLayout(); // // txtPath // _txtPath.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; _txtPath.Location = new Point(98, 33); _txtPath.Name = "_txtPath"; _txtPath.Size = new Size(668, 20); _txtPath.TabIndex = 0; // // btnBrwDic // _btnBrwDic.Location = new Point(21, 31); _btnBrwDic.Name = "_btnBrwDic"; _btnBrwDic.Size = new Size(75, 23); _btnBrwDic.TabIndex = 1; _btnBrwDic.Text = "Location"; _btnBrwDic.UseVisualStyleBackColor = true; _btnBrwDic.Click += btnBrwDic_Click; // // fbdSelect // _fbdSelect.Description = "Fastboot ROM"; // // btnRefresh // _btnRefresh.Anchor = AnchorStyles.Top | AnchorStyles.Right; _btnRefresh.Location = new Point(831, 29); _btnRefresh.Name = "_btnRefresh"; _btnRefresh.Size = new Size(75, 23); _btnRefresh.TabIndex = 2; _btnRefresh.Text = "Refresh"; _btnRefresh.UseVisualStyleBackColor = true; _btnRefresh.Click += btnRefresh_Click; // // btnFlash // _btnFlash.Anchor = AnchorStyles.Top | AnchorStyles.Right; _btnFlash.Location = new Point(951, 28); _btnFlash.Name = "_btnFlash"; _btnFlash.Size = new Size(75, 23); _btnFlash.TabIndex = 3; _btnFlash.Text = "flash"; _btnFlash.UseVisualStyleBackColor = true; _btnFlash.Click += btnFlash_Click; // // devicelist // _devicelist.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; _devicelist.Columns.AddRange(new[] { _clnID, _clnDevice, _clnProgress, _clnTime, _clnStatus, _clnResult }); _devicelist.GridLines = true; _devicelist.Location = new Point(21, 86); _devicelist.Name = "_devicelist"; _devicelist.Size = new Size(1005, 316); _devicelist.TabIndex = 4; _devicelist.UseCompatibleStateImageBehavior = false; _devicelist.View = View.Details; _devicelist.ColumnWidthChanging += devicelist_ColumnWidthChanging; // // clnID // _clnID.Text = "ID"; // // clnDevice // _clnDevice.Text = "Kenzo"; _clnDevice.Width = 90; // // clnProgress // _clnProgress.Text = "Progres"; _clnProgress.Width = 107; // // clnTime // _clnTime.Text = "Waktu"; // // clnStatus // _clnStatus.Text = "Status"; _clnStatus.Width = 500; // // clnResult // _clnResult.Text = "Hasil"; _clnResult.Width = 126; // // txtLog // _txtLog.Location = new Point(37, 421); _txtLog.Name = "_txtLog"; _txtLog.Size = new Size(949, 65); _txtLog.TabIndex = 6; _txtLog.Text = ""; _txtLog.Visible = false; // // timer_updateStatus // _timerUpdateStatus.Interval = 1000; _timerUpdateStatus.Tick += timer_updateStatus_Tick; // // statusStrp // _statusStrp.Items.AddRange(new ToolStripItem[] { _statusLblMsg, _statusTab, _rdoCleanAll, _rdoSaveUserData, _rdoCleanAllAndLock }); _statusStrp.Location = new Point(0, 422); _statusStrp.Name = "_statusStrp"; _statusStrp.Size = new Size(1094, 22); _statusStrp.TabIndex = 7; _statusStrp.Text = "statusStrip1"; // // statusLblMsg // _statusLblMsg.Name = "_statusLblMsg"; _statusLblMsg.Size = new Size(0, 17); // // statusTab // _statusTab.Name = "_statusTab"; _statusTab.Size = new Size(708, 17); _statusTab.Spring = true; // // rdoCleanAll // _rdoCleanAll.IsChecked = false; _rdoCleanAll.Name = "_rdoCleanAll"; _rdoCleanAll.Size = new Size(98, 20); _rdoCleanAll.Text = "Hapus Semua"; // // rdoSaveUserData // _rdoSaveUserData.IsChecked = true; _rdoSaveUserData.Name = "_rdoSaveUserData"; _rdoSaveUserData.Size = new Size(118, 20); _rdoSaveUserData.Text = "Simpan Data User"; // // rdoCleanAllAndLock // _rdoCleanAllAndLock.IsChecked = false; _rdoCleanAllAndLock.Name = "_rdoCleanAllAndLock"; _rdoCleanAllAndLock.Size = new Size(155, 20); _rdoCleanAllAndLock.Text = "Hapus Semua Dan Kunci"; // // lblMD5 // _lblMD5.AutoSize = true; _lblMD5.Location = new Point(96, 68); _lblMD5.Name = "_lblMD5"; _lblMD5.Size = new Size(0, 13); _lblMD5.TabIndex = 8; // // menuStrip1 // _menuStrip1.BackColor = SystemColors.ControlLight; _menuStrip1.GripStyle = ToolStripGripStyle.Visible; _menuStrip1.Items.AddRange(new ToolStripItem[] { _miConfiguration }); _menuStrip1.Location = new Point(0, 0); _menuStrip1.Name = "_menuStrip1"; _menuStrip1.RenderMode = ToolStripRenderMode.System; _menuStrip1.Size = new Size(1094, 24); _menuStrip1.TabIndex = 9; _menuStrip1.Text = "menuStrip1"; // // miConfiguration // _miConfiguration.DropDownItems.AddRange(new ToolStripItem[] { _miFlashConfigurationToolStripMenuItem, _miInstallDrivers }); _miConfiguration.Name = "_miConfiguration"; _miConfiguration.Size = new Size(93, 40); _miConfiguration.Text = "Configuration"; // // miFlashConfigurationToolStripMenuItem // _miFlashConfigurationToolStripMenuItem.Name = "_miFlashConfigurationToolStripMenuItem"; _miFlashConfigurationToolStripMenuItem.Size = new Size(178, 22); _miFlashConfigurationToolStripMenuItem.Text = "Configure MiFlash"; _miFlashConfigurationToolStripMenuItem.Click += miFlashConfigurationToolStripMenuItem_Click; // // miInstallDriver // _miInstallDrivers.Name = "_miInstallDrivers"; _miInstallDrivers.Size = new Size(178, 22); _miInstallDrivers.Text = "Install Drivers"; _miInstallDrivers.Click += miInstallDrivers_Click; // // MainFrm // ClientSize = new Size(1094, 444); Controls.Add(_lblMD5); Controls.Add(_statusStrp); Controls.Add(_menuStrip1); Controls.Add(_txtLog); Controls.Add(_devicelist); Controls.Add(_btnFlash); Controls.Add(_btnRefresh); Controls.Add(_btnBrwDic); Controls.Add(_txtPath); MainMenuStrip = _menuStrip1; Name = "MainFrm"; StartPosition = FormStartPosition.CenterScreen; Text = "QFlashKit (Beta)"; FormClosing += MainFrm_FormClosing; FormClosed += MainFrm_FormClosed; Load += MainFrm_Load; _statusStrp.ResumeLayout(false); _statusStrp.PerformLayout(); _menuStrip1.ResumeLayout(false); _menuStrip1.PerformLayout(); ResumeLayout(false); PerformLayout(); }
public void BindFrm() { MapData md = new MapData(); if (string.IsNullOrEmpty(this.FK_MapData) == false) { md.No = this.FK_MapData; md.RetrieveFromDBSources(); this.Pub1.AddH2("表单属性" + md.Name); this.Pub1.AddHR(); } else { this.Pub1.AddH2("新建表单"); this.Pub1.AddHR(); } this.Pub1.AddTable("align=left"); this.Pub1.AddTR(); this.Pub1.AddTDTitle("属性"); this.Pub1.AddTDTitle("采集"); this.Pub1.AddTDTitle("描述"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("表单名称"); TextBox tb = new TextBox(); tb.ID = "TB_Name"; tb.Text = md.Name; this.Pub1.AddTD(tb); this.Pub1.AddTD("描述"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("表单编号"); tb = new TextBox(); tb.ID = "TB_No"; tb.Text = md.No; if (string.IsNullOrEmpty(md.No) == false) { tb.Attributes["readonly"] = "true"; } this.Pub1.AddTD(tb); this.Pub1.AddTD("也是表单ID."); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("默认类型"); DDL ddl = new DDL(); ddl.ID = "DDL_FrmType"; ddl.BindSysEnum(MapDataAttr.FrmType, (int)md.HisFrmType); this.Pub1.AddTD(ddl); this.Pub1.AddTD(""); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("物理表/视图"); tb = new TextBox(); tb.ID = "TB_PTable"; tb.Text = md.No; this.Pub1.AddTD(tb); this.Pub1.AddTD("多个表单可以对应同一个表或视图<br>如果表不存在,ccflow会自动创建."); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("类别"); ddl = new DDL(); ddl.ID = "DDL_FK_FrmSort"; FrmSorts fss = new FrmSorts(); fss.RetrieveAll(); ddl.Bind(fss, md.FK_FrmSort); this.Pub1.AddTD(ddl); this.Pub1.AddTD(""); this.Pub1.AddTREnd(); //this.Pub1.AddTR(); //this.Pub1.AddTD("设计单位"); //tb = new TextBox(); //tb.ID = "TB_" + MapDataAttr.DesignerUnit; //tb.Text = md.DesignerUnit; //if (string.IsNullOrEmpty(tb.Text)) // tb.Text = BP.SystemConfig.DeveloperName; //tb.Columns = 60; //this.Pub1.AddTD("colspan=2", tb); //this.Pub1.AddTREnd(); //this.Pub1.AddTR(); //this.Pub1.AddTD("联系方式"); //tb = new TextBox(); //tb.ID = "TB_" + MapDataAttr.DesignerContact; //tb.Text = md.DesignerContact; //if (string.IsNullOrEmpty(tb.Text)) // tb.Text = BP.SystemConfig.ServiceTel + "," + BP.SystemConfig.ServiceMail; //tb.Columns = 60; //this.Pub1.AddTD("colspan=2", tb); //this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD(""); this.Pub1.AddTDBegin(); Button btn = new Button(); btn.ID = "Btn_Save"; btn.Text = "Save"; btn.CssClass = "Btn"; btn.Click += new EventHandler(btn_SaveFrm_Click); this.Pub1.Add(btn); if (string.IsNullOrEmpty(md.No) == false) { btn = new Button(); btn.ID = "Btn_Delete"; btn.Text = "Delete"; btn.CssClass = "Btn"; btn.Attributes["onclick"] = "return window.confirm('您确定要删除吗?')"; btn.Click += new EventHandler(btn_SaveFrm_Click); this.Pub1.Add(btn); } this.Pub1.AddTDEnd(); this.Pub1.AddTD(""); this.Pub1.AddTREnd(); if (string.IsNullOrEmpty(md.No) == false) { this.Pub1.AddTR(); this.Pub1.AddTDBegin("colspan=3"); // this.Pub1.Add("<a href='FlowFrms.aspx?ShowType=FrmLib&DoType=DelFrm&FK_Node=" + FK_Node + "&FK_MapData=" + md.No + "' ><img src='/WF/Img/Btn/Delete.gif' border=0 />删除</a>"); this.Pub1.Add("<a href='../MapDef/ViewFrm.aspx?DoType=Column4Frm&FK_MapData=" + md.No + "' target=_blank ><img src='/WF/Img/Btn/View.gif' border=0 />傻瓜表单预览</a>"); this.Pub1.Add("<a href='../Frm.aspx?FK_MapData=" + md.No + "&IsTest=1&WorkID=0' target=_blank ><img src='/WF/Img/Btn/View.gif' border=0 />自由表单预览</a>"); this.Pub1.Add("<a href='../MapDef/ViewFrm.aspx?DoType=dd&FK_MapData=" + md.No + "' target=_blank ><img src='/WF/Img/Btn/View.gif' border=0 />手机表单预览</a>"); this.Pub1.Add("<a href='../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "' target=_blank ><img src='/WF/Img/Btn/View.gif' border=0 />启动自由表单设计器</a>"); this.Pub1.Add("<a href='../MapDef/MapDef.aspx?PK=" + md.No + "' target=_blank ><img src='/WF/Img/Btn/View.gif' border=0 />启动傻瓜表单设计器</a>"); this.Pub1.AddTDEnd(); this.Pub1.AddTREnd(); } this.Pub1.AddTableEnd(); }
private int GetInt(TextBox textBox) { int i = 0; return(int.TryParse(textBox.Text, out i) ? i : 0); }
/// <summary> /// Input text... /// </summary> /// <param name="title">title of the box</param> /// <param name="promptText">prompt to the user</param> /// <param name="value">text typed by the user</param> /// <returns>button pressed</returns> private static DialogResult InputBox(string a_szTitle, string a_szPrompt, ref string a_szValue) { DialogResult dialogResult = DialogResult.Cancel; Form form = null; Label label = null; TextBox textBox = null; Button buttonOk = null; Button buttonCancel = null; try { form = new Form(); label = new Label(); textBox = new TextBox(); buttonOk = new Button(); buttonCancel = new Button(); form.Text = a_szTitle; label.Text = a_szPrompt; textBox.Text = a_szValue; buttonOk.Text = "OK"; buttonCancel.Text = "Cancel"; buttonOk.DialogResult = DialogResult.OK; buttonCancel.DialogResult = DialogResult.Cancel; label.SetBounds(9, 20, 472, 13); textBox.SetBounds(12, 56, 472, 20); buttonOk.SetBounds(328, 92, 75, 23); buttonCancel.SetBounds(409, 92, 75, 23); label.AutoSize = true; textBox.Anchor = textBox.Anchor | AnchorStyles.Right; buttonOk.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; form.ClientSize = new Size(496, 127); form.Controls.AddRange(new Control[] { label, textBox, buttonOk, buttonCancel }); form.ClientSize = new Size(Math.Max(400, label.Right + 10), form.ClientSize.Height); form.FormBorderStyle = FormBorderStyle.FixedDialog; form.StartPosition = FormStartPosition.CenterScreen; form.MinimizeBox = false; form.MaximizeBox = false; form.AcceptButton = buttonOk; form.CancelButton = buttonCancel; dialogResult = form.ShowDialog(); a_szValue = textBox.Text; } catch (Exception exception) { Log.Error("Something bad happened..." + exception.Message); } finally { // On the advice of analyze... if (form != null) { form.Dispose(); form = null; } if (label != null) { label.Dispose(); label = null; } if (textBox != null) { textBox.Dispose(); textBox = null; } if (buttonOk != null) { buttonOk.Dispose(); buttonOk = null; } if (buttonCancel != null) { buttonCancel.Dispose(); buttonCancel = null; } } // All done... return (dialogResult); }
public static void execute(String cmd, TextBox textBox) { WinCmd.cmd("adb " + "shell " + cmd, textBox); }
internal void PopulateAutoCompleteTextbox(TextBox autoCompleteTextbox, string inputKey) { autoCompleteTextbox.AutoCompleteCustomSource.AddRange(excelFileActualData[inputKey]); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormSigButDefEdit)); this.label2 = new System.Windows.Forms.Label(); this.textButtonText = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.butDelete = new OpenDental.UI.Button(); this.textSynchIcon = new OpenDental.ValidNum(); this.butOK = new OpenDental.UI.Button(); this.butCancel = new OpenDental.UI.Button(); this.radioAll = new System.Windows.Forms.RadioButton(); this.radioOne = new System.Windows.Forms.RadioButton(); this.textComputerName = new System.Windows.Forms.TextBox(); this.comboTo = new System.Windows.Forms.ComboBox(); this.label4 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.comboExtras = new System.Windows.Forms.ComboBox(); this.label11 = new System.Windows.Forms.Label(); this.comboMessage = new System.Windows.Forms.ComboBox(); this.SuspendLayout(); // // label2 // this.label2.ImageAlign = System.Drawing.ContentAlignment.TopRight; this.label2.Location = new System.Drawing.Point(102, 84); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 20); this.label2.TabIndex = 4; this.label2.Text = "Text"; this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight; // // textButtonText // this.textButtonText.Location = new System.Drawing.Point(204, 81); this.textButtonText.Name = "textButtonText"; this.textButtonText.Size = new System.Drawing.Size(105, 20); this.textButtonText.TabIndex = 0; // // label3 // this.label3.ImageAlign = System.Drawing.ContentAlignment.TopRight; this.label3.Location = new System.Drawing.Point(261, 104); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(304, 40); this.label3.TabIndex = 6; this.label3.Text = "The cell number (1-9) of the main program icon that should light up whenever this" + " button lights up. 0 for none."; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label5 // this.label5.ImageAlign = System.Drawing.ContentAlignment.TopRight; this.label5.Location = new System.Drawing.Point(102, 114); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(100, 20); this.label5.TabIndex = 8; this.label5.Text = "Synch Icon"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // openFileDialog1 // this.openFileDialog1.FileName = "openFileDialog1"; // // butDelete // this.butDelete.AdjustImageLocation = new System.Drawing.Point(0, 0); this.butDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.butDelete.Autosize = true; this.butDelete.BtnShape = OpenDental.UI.enumType.BtnShape.Rectangle; this.butDelete.BtnStyle = OpenDental.UI.enumType.XPStyle.Silver; this.butDelete.CornerRadius = 4F; this.butDelete.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.butDelete.Location = new System.Drawing.Point(45, 292); this.butDelete.Name = "butDelete"; this.butDelete.Size = new System.Drawing.Size(82, 26); this.butDelete.TabIndex = 14; this.butDelete.Text = "&Delete"; this.butDelete.Click += new System.EventHandler(this.butDelete_Click); // // textSynchIcon // this.textSynchIcon.Location = new System.Drawing.Point(204, 114); this.textSynchIcon.MaxVal = 9; this.textSynchIcon.MinVal = 0; this.textSynchIcon.Name = "textSynchIcon"; this.textSynchIcon.Size = new System.Drawing.Size(51, 20); this.textSynchIcon.TabIndex = 1; // // butOK // this.butOK.AdjustImageLocation = new System.Drawing.Point(0, 0); this.butOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.butOK.Autosize = true; this.butOK.BtnShape = OpenDental.UI.enumType.BtnShape.Rectangle; this.butOK.BtnStyle = OpenDental.UI.enumType.XPStyle.Silver; this.butOK.CornerRadius = 4F; this.butOK.Location = new System.Drawing.Point(442, 292); this.butOK.Name = "butOK"; this.butOK.Size = new System.Drawing.Size(75, 26); this.butOK.TabIndex = 2; this.butOK.Text = "&OK"; this.butOK.Click += new System.EventHandler(this.butOK_Click); // // butCancel // this.butCancel.AdjustImageLocation = new System.Drawing.Point(0, 0); this.butCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.butCancel.Autosize = true; this.butCancel.BtnShape = OpenDental.UI.enumType.BtnShape.Rectangle; this.butCancel.BtnStyle = OpenDental.UI.enumType.XPStyle.Silver; this.butCancel.CornerRadius = 4F; this.butCancel.Location = new System.Drawing.Point(544, 292); this.butCancel.Name = "butCancel"; this.butCancel.Size = new System.Drawing.Size(75, 26); this.butCancel.TabIndex = 3; this.butCancel.Text = "&Cancel"; this.butCancel.Click += new System.EventHandler(this.butCancel_Click); // // radioAll // this.radioAll.AutoCheck = false; this.radioAll.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; this.radioAll.Location = new System.Drawing.Point(2, 10); this.radioAll.Name = "radioAll"; this.radioAll.Size = new System.Drawing.Size(214, 20); this.radioAll.TabIndex = 15; this.radioAll.TabStop = true; this.radioAll.Text = "Applies to all computers"; this.radioAll.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.radioAll.UseVisualStyleBackColor = true; // // radioOne // this.radioOne.AutoCheck = false; this.radioOne.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; this.radioOne.Location = new System.Drawing.Point(2, 33); this.radioOne.Name = "radioOne"; this.radioOne.Size = new System.Drawing.Size(214, 20); this.radioOne.TabIndex = 16; this.radioOne.TabStop = true; this.radioOne.Text = "Only applies to one computer:"; this.radioOne.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.radioOne.UseVisualStyleBackColor = true; // // textComputerName // this.textComputerName.Location = new System.Drawing.Point(225, 33); this.textComputerName.Name = "textComputerName"; this.textComputerName.ReadOnly = true; this.textComputerName.Size = new System.Drawing.Size(154, 20); this.textComputerName.TabIndex = 17; // // comboTo // this.comboTo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboTo.FormattingEnabled = true; this.comboTo.Location = new System.Drawing.Point(204, 147); this.comboTo.MaxDropDownItems = 30; this.comboTo.Name = "comboTo"; this.comboTo.Size = new System.Drawing.Size(121, 21); this.comboTo.TabIndex = 18; // // label4 // this.label4.ImageAlign = System.Drawing.ContentAlignment.TopRight; this.label4.Location = new System.Drawing.Point(102, 148); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(100, 20); this.label4.TabIndex = 19; this.label4.Text = "To User"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label10 // this.label10.ImageAlign = System.Drawing.ContentAlignment.TopRight; this.label10.Location = new System.Drawing.Point(102, 183); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(100, 20); this.label10.TabIndex = 24; this.label10.Text = "Extras"; this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // comboExtras // this.comboExtras.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboExtras.FormattingEnabled = true; this.comboExtras.Location = new System.Drawing.Point(204, 182); this.comboExtras.MaxDropDownItems = 30; this.comboExtras.Name = "comboExtras"; this.comboExtras.Size = new System.Drawing.Size(121, 21); this.comboExtras.TabIndex = 23; // // label11 // this.label11.ImageAlign = System.Drawing.ContentAlignment.TopRight; this.label11.Location = new System.Drawing.Point(102, 217); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(100, 20); this.label11.TabIndex = 26; this.label11.Text = "Message"; this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // comboMessage // this.comboMessage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboMessage.FormattingEnabled = true; this.comboMessage.Location = new System.Drawing.Point(204, 216); this.comboMessage.MaxDropDownItems = 30; this.comboMessage.Name = "comboMessage"; this.comboMessage.Size = new System.Drawing.Size(121, 21); this.comboMessage.TabIndex = 25; // // FormSigButDefEdit // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(671, 343); this.Controls.Add(this.label11); this.Controls.Add(this.comboMessage); this.Controls.Add(this.label10); this.Controls.Add(this.comboExtras); this.Controls.Add(this.label4); this.Controls.Add(this.comboTo); this.Controls.Add(this.textComputerName); this.Controls.Add(this.radioOne); this.Controls.Add(this.radioAll); this.Controls.Add(this.butDelete); this.Controls.Add(this.textSynchIcon); this.Controls.Add(this.label5); this.Controls.Add(this.label3); this.Controls.Add(this.textButtonText); this.Controls.Add(this.label2); this.Controls.Add(this.butOK); this.Controls.Add(this.butCancel); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "FormSigButDefEdit"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Edit Message Button"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormSigButDefEdit_FormClosing); this.Load += new System.EventHandler(this.FormSigButDefEdit_Load); this.ResumeLayout(false); this.PerformLayout(); }
public ConfigureController() { InitializeComponent(); this.PreviewKeyDown += new KeyEventHandler(HandleEsc); _timer.Tick += Timer_Tick; // get the mainwindow mw = Application.Current.Windows.OfType <MainWindow>().FirstOrDefault(); //Input.Initialize(mw); // set the controller definition from mainwindow if (mw.ControllerDefinition == null) { this.Close(); } ControllerDefinition = mw.ControllerDefinition; string vPortStr = ""; if (ControllerDefinition.VirtualPort > 0) { vPortStr = " - Virtual Port: " + ControllerDefinition.VirtualPort; } // set the title titleTextBlock.Text = "Configure " + ControllerDefinition.DeviceName + vPortStr; // headers Label headDesc = new Label(); headDesc.Content = "Binding"; headDesc.SetValue(Grid.ColumnProperty, 0); headDesc.SetValue(Grid.RowProperty, 0); DynamicDataGrid.Children.Add(headDesc); Label headConfig1 = new Label(); headConfig1.Content = "Primary"; headConfig1.SetValue(Grid.ColumnProperty, 1); headConfig1.SetValue(Grid.RowProperty, 0); DynamicDataGrid.Children.Add(headConfig1); Label headConfig2 = new Label(); headConfig2.Content = "Secondary"; headConfig2.SetValue(Grid.ColumnProperty, 2); headConfig2.SetValue(Grid.RowProperty, 0); DynamicDataGrid.Children.Add(headConfig2); Label headConfig3 = new Label(); headConfig3.Content = "Tertiary"; headConfig3.SetValue(Grid.ColumnProperty, 3); headConfig3.SetValue(Grid.RowProperty, 0); DynamicDataGrid.Children.Add(headConfig3); Label headCustom = new Label(); headCustom.Content = "Custom Insert"; headCustom.SetValue(Grid.ColumnProperty, 4); headCustom.SetValue(Grid.RowProperty, 0); DynamicDataGrid.Children.Add(headCustom); // loop through maplist and populate the dynamic data grid row by row for (int i = 0; i < ControllerDefinition.MapList.Count; i++) { // description Label desc = new Label(); desc.Content = ControllerDefinition.MapList[i].Description; desc.SetValue(Grid.ColumnProperty, 0); desc.SetValue(Grid.RowProperty, i + 1); ToolTip tt = new System.Windows.Controls.ToolTip(); tt.Content = ControllerDefinition.MapList[i].MednafenCommand; desc.ToolTip = tt; KeyboardNavigation.SetIsTabStop(desc, false); DynamicDataGrid.Children.Add(desc); // Config Primary TextBox configInfo = new TextBox(); configInfo.Name = "Primary_" + TranslateConfigName(ControllerDefinition.MapList[i].MednafenCommand); configInfo.Text = KeyboardTranslation.SDLCodetoDx(GetConfigItem(ControllerDefinition.MapList[i].MednafenCommand, ConfigOrder.Primary), KeyboardType.UK); //ControllerDefinition.MapList[i].Config; configInfo.GotFocus += TextBox_GotFocus; configInfo.LostFocus += TextBox_LostFocus; configInfo.KeyDown += TextBox_KeyDownHandler; configInfo.IsReadOnly = true; configInfo.MinWidth = 100; configInfo.SetValue(Grid.ColumnProperty, 1); configInfo.SetValue(Grid.RowProperty, i + 1); KeyboardNavigation.SetTabIndex(configInfo, i + 1); DynamicDataGrid.Children.Add(configInfo); // Config Secondary TextBox configInfo2 = new TextBox(); configInfo2.Name = "Secondary_" + TranslateConfigName(ControllerDefinition.MapList[i].MednafenCommand); configInfo2.Text = KeyboardTranslation.SDLCodetoDx(GetConfigItem(ControllerDefinition.MapList[i].MednafenCommand, ConfigOrder.Secondary), KeyboardType.UK); //ControllerDefinition.MapList[i].Config; configInfo2.GotFocus += TextBox_GotFocus; configInfo2.LostFocus += TextBox_LostFocus; configInfo2.KeyDown += TextBox_KeyDownHandler; configInfo2.IsReadOnly = true; configInfo2.MinWidth = 100; configInfo2.SetValue(Grid.ColumnProperty, 2); configInfo2.SetValue(Grid.RowProperty, i + 1); KeyboardNavigation.SetTabIndex(configInfo2, i + 1 + ControllerDefinition.MapList.Count); DynamicDataGrid.Children.Add(configInfo2); // Config Tertiary TextBox configInfo3 = new TextBox(); configInfo3.Name = "Tertiary_" + TranslateConfigName(ControllerDefinition.MapList[i].MednafenCommand); configInfo3.Text = KeyboardTranslation.SDLCodetoDx(GetConfigItem(ControllerDefinition.MapList[i].MednafenCommand, ConfigOrder.Tertiary), KeyboardType.UK); //ControllerDefinition.MapList[i].Config; configInfo3.GotFocus += TextBox_GotFocus; configInfo3.LostFocus += TextBox_LostFocus; configInfo3.KeyDown += TextBox_KeyDownHandler; configInfo3.IsReadOnly = true; configInfo3.MinWidth = 100; configInfo3.SetValue(Grid.ColumnProperty, 3); configInfo3.SetValue(Grid.RowProperty, i + 1); KeyboardNavigation.SetTabIndex(configInfo3, i + 1 + (ControllerDefinition.MapList.Count * 2)); DynamicDataGrid.Children.Add(configInfo3); // configure button Button btn = new Button(); btn.Content = "Configure"; btn.Name = "btn" + TranslateConfigName(ControllerDefinition.MapList[i].MednafenCommand); btn.Click += btnConfigureSingle_Click; btn.SetValue(Grid.ColumnProperty, 4); btn.SetValue(Grid.RowProperty, i + 1); KeyboardNavigation.SetIsTabStop(btn, false); DynamicDataGrid.Children.Add(btn); } // populate the image BitmapImage b = GetImage(ControllerDefinition.DeviceName); if (b != null) { img.Source = b; } }
public static void SetWatermark(this TextBox textBox, string watermarkText) { SendMessage(textBox.Handle, EM_SETCUEBANNER, 0, watermarkText); }
public TextBoxAppendTraceListener(TextBox textBox) { _textBox = textBox; }
internal void PlotLabelsForTitles() { int widthForWindowFactor; if (excelFileData.ContainsKey("TitlesCount")) { widthForWindowFactor = int.Parse(excelFileData["TitlesCount"]); this.Width = widthForWindowFactor * 100 + 20 * (widthForWindowFactor + 2) + 10 + 100; // Size of button this.Height = 300; int titleCount = 0; int centerAlignment = 0; FontFamily family = new FontFamily("Times New Roman"); Font font = new Font(family, 13.0f, FontStyle.Bold); for (; titleCount < widthForWindowFactor; titleCount++) { Label newLabel = new Label(); TextBox newTextBox = new TextBox(); string temp = "Title" + (titleCount + 1).ToString(); if (excelFileData.ContainsKey(temp)) { newLabel.Name = "label" + excelFileData[temp]; newLabel.Text = excelFileData[temp]; newTextBox.Name = "textBox" + excelFileData[temp]; newTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource; newTextBox.AutoCompleteMode = AutoCompleteMode.Suggest; newTextBox.AutoCompleteCustomSource.AddRange(excelFileActualData[excelFileData[temp]]); } newLabel.Location = new Point(100 * titleCount + 20 * (titleCount + 1) + centerAlignment, 30); newLabel.Font = font; newLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight; newTextBox.Location = new Point(100 * titleCount + 20 * (titleCount + 1), 30 + 30); newLabel.AutoSize = true; newTextBox.Width = 110; newTextBox.KeyUp += AutoTextBoxChanged; newTextBox.Click += new System.EventHandler(SelectTextInTextBox); newTextBox.TextChanged += EmptyStringHandler; this.Controls.Add(newLabel); this.Controls.Add(newTextBox); this.MaximizeBox = false; this.MinimizeBox = false; this.FormBorderStyle = FormBorderStyle.FixedSingle; } Button newButton = new Button(); newButton.Text = "Update"; newButton.Name = "UpdateButton"; newButton.Location = new Point(100 * titleCount + 20 * (titleCount + 1), 30 + 30); newButton.Width = 100; this.Controls.Add(newButton); } }
/// <summary> /// Builds the specified node to a Panel. /// </summary> /// <param name="node">Node to build to the Panel.</param> /// <param name="position">Defines the positioning parameters.</param> /// <returns></returns> private Panel BuildToPanel(IConfigurationNode node, Position position) { Panel panel = new Panel(); panel.Tag = node == null ? null : node.ConfigObj; panel.AutoSize = false; panel.Height = 0; panel.Width = position.FullWidth; panel.Padding = new Padding(0, 0, 0, 0); panel.Margin = new Padding(0, 0, 0, 0); if (node == null || node.ConfigObj == null) { return(panel); // Return empty panel } panel.Name = string.Format("{0}_{1}", node.Location, node.ConfigObj); // Add heading if (node.ConfigObj is ConfigGroup) { panel.Controls.Add(CreateHeading(position, node.ConfigObj.Text.Evaluate())); position.LinePosition += position.LineHeight; } // Add subcontrols foreach (IConfigurationNode subNode in node.ChildNodes) { if (subNode.ConfigObj.Hidden) { continue; } if (subNode.ConfigObj is ConfigGroup) { Position pos = (Position)position.Clone(); pos.StartColumnOne += pos.Indent; // indent the first column pos.WidthColumnOne -= pos.Indent; // shorten the width, so it doesn't overlap with column two pos.LinePosition = 0; // reset linePosition, this is relative to the new control // Make a recursive call to process the group to a Panel Panel subPanel = BuildToPanel(subNode, pos); subPanel.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; subPanel.Location = new Point(0, position.LinePosition); subPanel.Enabled = !subNode.ConfigObj.Disabled; panel.Controls.Add(subPanel); position.LinePosition += pos.LinePosition; } else if (subNode.ConfigObj is ConfigSetting) { ConfigSetting setting = (ConfigSetting)subNode.ConfigObj; setting.OnChangeEvent += _configChangedHandler; if (setting is Entry) { panel.Controls.Add(CreateLabel(position, setting.Text.Evaluate())); TextBox txt = CreateTextBox(position, setting.Columns); txt.Text = ((Entry)setting).Value; txt.Tag = setting; SetHelp(txt, setting.Help.Evaluate()); txt.Enabled = !setting.Disabled; panel.Controls.Add(txt); position.LinePosition += position.LineHeight + position.Margin; } else if (setting is LimitedNumberSelect) { int height; panel.Controls.Add(CreateLabel(position, setting.Text.Evaluate(), position.Width, out height)); panel.Controls.Add(CreateLimitedNumberSelect(position, (LimitedNumberSelect)setting)); position.LinePosition += height + position.Margin; } else if (setting is MultipleEntryList) { panel.Controls.Add(CreateLabel(position, setting.Text.Evaluate())); position.LinePosition += position.LineHeight; TextBox txt = CreateMultiLineTextBox(position, setting.Rows); txt.Tag = setting; MultipleEntryList entryList = (MultipleEntryList)setting; txt.Lines = new string[entryList.Lines.Count]; for (int i = 0; i < txt.Lines.Length; i++) { txt.Lines[i] = entryList.Lines[i]; } SetHelp(txt, setting.Help.Evaluate()); txt.Enabled = !setting.Disabled; panel.Controls.Add(txt); position.LinePosition += txt.Height + position.Margin; } else if (setting is MultipleSelectionList) { int lblHeight; panel.Controls.Add(CreateLabel(position, setting.Text.Evaluate(), position.WidthColumnOne, out lblHeight)); position.LinePosition += lblHeight + position.Margin; CheckedListBox chk = CreateCheckedListBox(position); MultipleSelectionList list = ((MultipleSelectionList)setting); for (int i = 0; i < list.Items.Count; i++) { chk.Items.Add(list.Items[i], list.SelectedIndices.Contains(i)); } chk.Enabled = !setting.Disabled; panel.Controls.Add(chk); position.LinePosition += chk.Height + position.Margin; } else if (setting is NumberSelect) { int height; panel.Controls.Add(CreateLabel(position, setting.Text.Evaluate(), position.Width, out height)); panel.Controls.Add(CreateNumberSelect(position, (NumberSelect)setting)); position.LinePosition += height + position.Margin; } else if (setting is Path) { int height; panel.Controls.Add(CreateLabel(position, setting.Text.Evaluate(), position.Width, out height)); position.LinePosition += height + position.Margin; Panel browse = CreateBrowseEntry(position, (Path)setting); panel.Controls.Add(browse); position.LinePosition += browse.Height + position.Margin; } else if (setting is PreferenceList) { int height; panel.Controls.Add(CreateLabel(position, setting.Text.Evaluate(), position.Width, out height)); position.LinePosition += height + position.Margin; Panel list = CreatePreferenceList(position, (PreferenceList)setting); panel.Controls.Add(list); position.LinePosition += list.Height + position.Margin; } else if (setting is SingleSelectionList) { int lblHeight; panel.Controls.Add(CreateLabel(position, setting.Text.Evaluate(), position.WidthColumnOne, out lblHeight)); lblHeight += position.Margin; if (((SingleSelectionList)setting).Items.Count > 3) // ComboBox { ComboBox cmb = CreateComboBox(position); foreach (IResourceString item in ((SingleSelectionList)setting).Items) { cmb.Items.Add(item.Evaluate()); } cmb.SelectedIndex = ((SingleSelectionList)setting).Selected; cmb.Tag = setting; SetHelp(cmb, setting.Help.Evaluate()); cmb.Enabled = !setting.Disabled; panel.Controls.Add(cmb); if (lblHeight > position.LineHeight) { position.LinePosition += (position.ItemHeight * (lblHeight / (position.ItemHeight * 2))); } position.LinePosition += position.LineHeight; } else // 3 or less items: Radiobuttons { Panel radioPanel = CreateRadioPanel(position, (SingleSelectionList)setting); panel.Enabled = !setting.Disabled; panel.Controls.Add(radioPanel); position.LinePosition += radioPanel.Height + position.Margin; } } else if (setting is YesNo) { int lblHeight; panel.Controls.Add(CreateLabel(position, setting.Text.Evaluate(), position.WidthColumnOne, out lblHeight)); lblHeight += position.Margin; CheckBox chk = CreateCheckBox(position); chk.Checked = ((YesNo)setting).Yes; chk.Tag = setting; SetHelp(chk, setting.Help.Evaluate()); chk.Enabled = !setting.Disabled; panel.Controls.Add(chk); if (lblHeight > position.LineHeight) { position.LinePosition += (position.ItemHeight * (lblHeight / (position.ItemHeight * 2))); } position.LinePosition += position.LineHeight; } } } panel.Height = position.LinePosition; return(panel); }
private void InitializeComponent() { TableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); Cancel_Button = new System.Windows.Forms.Button(); OK_Button = new System.Windows.Forms.Button(); txtPattern = new System.Windows.Forms.TextBox(); Label2 = new System.Windows.Forms.Label(); Label3 = new System.Windows.Forms.Label(); Label4 = new System.Windows.Forms.Label(); Label5 = new System.Windows.Forms.Label(); Label6 = new System.Windows.Forms.Label(); Label7 = new System.Windows.Forms.Label(); cmdTest = new System.Windows.Forms.Button(); tabImport = new System.Windows.Forms.TabControl(); TabPage1 = new System.Windows.Forms.TabPage(); label1 = new System.Windows.Forms.Label(); txtDefaultPlot = new System.Windows.Forms.TextBox(); udDefaultVolume = new System.Windows.Forms.NumericUpDown(); chkPlot = new System.Windows.Forms.CheckBox(); chkVol = new System.Windows.Forms.CheckBox(); chkSeries = new System.Windows.Forms.CheckBox(); cboDefaultSeries = new System.Windows.Forms.ComboBox(); chkGroup = new System.Windows.Forms.CheckBox(); cboDefaultGroup = new System.Windows.Forms.ComboBox(); chkPublisher = new System.Windows.Forms.CheckBox(); cboDefaultPublisher = new System.Windows.Forms.ComboBox(); TabPage3 = new System.Windows.Forms.TabPage(); cmdBuffer = new System.Windows.Forms.Button(); label8 = new System.Windows.Forms.Label(); cmdOption = new System.Windows.Forms.Button(); cmdConvert = new System.Windows.Forms.Button(); cmdPublisher = new System.Windows.Forms.Button(); cmdGroup = new System.Windows.Forms.Button(); cmdIssue = new System.Windows.Forms.Button(); cmdPlot = new System.Windows.Forms.Button(); cmdSeries = new System.Windows.Forms.Button(); cmdVolume = new System.Windows.Forms.Button(); txtKeywords = new System.Windows.Forms.TextBox(); TabPage2 = new System.Windows.Forms.TabPage(); udRegexIssue = new System.Windows.Forms.NumericUpDown(); udRegexPlot = new System.Windows.Forms.NumericUpDown(); udRegexVolume = new System.Windows.Forms.NumericUpDown(); udRegexSeries = new System.Windows.Forms.NumericUpDown(); udRegexGroup = new System.Windows.Forms.NumericUpDown(); udRegexPublisher = new System.Windows.Forms.NumericUpDown(); cboPresets = new System.Windows.Forms.ComboBox(); cboTest = new System.Windows.Forms.ComboBox(); label9 = new System.Windows.Forms.Label(); TableLayoutPanel1.SuspendLayout(); tabImport.SuspendLayout(); TabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)udDefaultVolume).BeginInit(); TabPage3.SuspendLayout(); TabPage2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)udRegexIssue).BeginInit(); ((System.ComponentModel.ISupportInitialize)udRegexPlot).BeginInit(); ((System.ComponentModel.ISupportInitialize)udRegexVolume).BeginInit(); ((System.ComponentModel.ISupportInitialize)udRegexSeries).BeginInit(); ((System.ComponentModel.ISupportInitialize)udRegexGroup).BeginInit(); ((System.ComponentModel.ISupportInitialize)udRegexPublisher).BeginInit(); SuspendLayout(); TableLayoutPanel1.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); TableLayoutPanel1.ColumnCount = 2; TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50f)); TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50f)); TableLayoutPanel1.Controls.Add(Cancel_Button, 1, 0); TableLayoutPanel1.Controls.Add(OK_Button, 0, 0); TableLayoutPanel1.Location = new System.Drawing.Point(193, 286); TableLayoutPanel1.Name = "TableLayoutPanel1"; TableLayoutPanel1.RowCount = 1; TableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50f)); TableLayoutPanel1.Size = new System.Drawing.Size(146, 29); TableLayoutPanel1.TabIndex = 0; Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None; Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel; Cancel_Button.Location = new System.Drawing.Point(76, 3); Cancel_Button.Name = "Cancel_Button"; Cancel_Button.Size = new System.Drawing.Size(67, 23); Cancel_Button.TabIndex = 15; Cancel_Button.Text = "Cancel"; Cancel_Button.Click += new System.EventHandler(Cancel_Button_Click); OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None; OK_Button.DialogResult = System.Windows.Forms.DialogResult.OK; OK_Button.Location = new System.Drawing.Point(3, 3); OK_Button.Name = "OK_Button"; OK_Button.Size = new System.Drawing.Size(67, 23); OK_Button.TabIndex = 14; OK_Button.Text = "OK"; OK_Button.Click += new System.EventHandler(OK_Button_Click); txtPattern.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); txtPattern.Location = new System.Drawing.Point(16, 55); txtPattern.Multiline = true; txtPattern.Name = "txtPattern"; txtPattern.Size = new System.Drawing.Size(281, 61); txtPattern.TabIndex = 1; Label2.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); Label2.AutoSize = true; Label2.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); Label2.Location = new System.Drawing.Point(14, 128); Label2.Name = "Label2"; Label2.Size = new System.Drawing.Size(55, 12); Label2.TabIndex = 5; Label2.Text = "Publisher:"; Label3.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); Label3.AutoSize = true; Label3.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); Label3.Location = new System.Drawing.Point(14, 150); Label3.Name = "Label3"; Label3.Size = new System.Drawing.Size(38, 12); Label3.TabIndex = 6; Label3.Text = "Group:"; Label4.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); Label4.AutoSize = true; Label4.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); Label4.Location = new System.Drawing.Point(123, 150); Label4.Name = "Label4"; Label4.Size = new System.Drawing.Size(56, 12); Label4.TabIndex = 7; Label4.Text = "Plot Title:"; Label5.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); Label5.AutoSize = true; Label5.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); Label5.Location = new System.Drawing.Point(14, 171); Label5.Name = "Label5"; Label5.Size = new System.Drawing.Size(39, 12); Label5.TabIndex = 8; Label5.Text = "Series:"; Label6.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); Label6.AutoSize = true; Label6.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); Label6.Location = new System.Drawing.Point(123, 171); Label6.Name = "Label6"; Label6.Size = new System.Drawing.Size(36, 12); Label6.TabIndex = 9; Label6.Text = "Issue:"; Label7.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); Label7.AutoSize = true; Label7.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); Label7.Location = new System.Drawing.Point(123, 128); Label7.Name = "Label7"; Label7.Size = new System.Drawing.Size(46, 12); Label7.TabIndex = 15; Label7.Text = "Volume:"; cmdTest.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); cmdTest.Location = new System.Drawing.Point(244, 202); cmdTest.Name = "cmdTest"; cmdTest.Size = new System.Drawing.Size(58, 21); cmdTest.TabIndex = 9; cmdTest.Text = "Test"; cmdTest.UseVisualStyleBackColor = true; cmdTest.Click += new System.EventHandler(cmdTest_Click); tabImport.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right); tabImport.Controls.Add(TabPage1); tabImport.Controls.Add(TabPage3); tabImport.Controls.Add(TabPage2); tabImport.Location = new System.Drawing.Point(11, 12); tabImport.Name = "tabImport"; tabImport.SelectedIndex = 0; tabImport.Size = new System.Drawing.Size(328, 266); tabImport.TabIndex = 13; TabPage1.Controls.Add(label1); TabPage1.Controls.Add(txtDefaultPlot); TabPage1.Controls.Add(udDefaultVolume); TabPage1.Controls.Add(chkPlot); TabPage1.Controls.Add(chkVol); TabPage1.Controls.Add(chkSeries); TabPage1.Controls.Add(cboDefaultSeries); TabPage1.Controls.Add(chkGroup); TabPage1.Controls.Add(cboDefaultGroup); TabPage1.Controls.Add(chkPublisher); TabPage1.Controls.Add(cboDefaultPublisher); TabPage1.Location = new System.Drawing.Point(4, 22); TabPage1.Name = "TabPage1"; TabPage1.Padding = new System.Windows.Forms.Padding(3); TabPage1.Size = new System.Drawing.Size(320, 240); TabPage1.TabIndex = 0; TabPage1.Text = "Default"; TabPage1.UseVisualStyleBackColor = true; label1.AutoSize = true; label1.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); label1.Location = new System.Drawing.Point(27, 13); label1.Name = "label1"; label1.Size = new System.Drawing.Size(252, 24); label1.TabIndex = 11; label1.Text = "Carbon Comic will use these tags if it cannot find \r\na match for your pattern."; label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; txtDefaultPlot.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); txtDefaultPlot.Location = new System.Drawing.Point(104, 196); txtDefaultPlot.Name = "txtDefaultPlot"; txtDefaultPlot.Size = new System.Drawing.Size(188, 20); txtDefaultPlot.TabIndex = 10; txtDefaultPlot.TextChanged += new System.EventHandler(txtDefaultPlot_TextChanged); udDefaultVolume.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); udDefaultVolume.Location = new System.Drawing.Point(104, 158); udDefaultVolume.Name = "udDefaultVolume"; udDefaultVolume.Size = new System.Drawing.Size(47, 20); udDefaultVolume.TabIndex = 8; udDefaultVolume.Value = new decimal(new int[4] { 1, 0, 0, 0 }); udDefaultVolume.ValueChanged += new System.EventHandler(udDefaultVolume_ValueChanged); chkPlot.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); chkPlot.AutoSize = true; chkPlot.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); chkPlot.Location = new System.Drawing.Point(16, 199); chkPlot.Name = "chkPlot"; chkPlot.Size = new System.Drawing.Size(73, 16); chkPlot.TabIndex = 9; chkPlot.Text = "Plot Title:"; chkPlot.UseVisualStyleBackColor = true; chkVol.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); chkVol.AutoSize = true; chkVol.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); chkVol.Location = new System.Drawing.Point(16, 160); chkVol.Name = "chkVol"; chkVol.Size = new System.Drawing.Size(63, 16); chkVol.TabIndex = 7; chkVol.Text = "Volume:"; chkVol.UseVisualStyleBackColor = true; chkSeries.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); chkSeries.AutoSize = true; chkSeries.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); chkSeries.Location = new System.Drawing.Point(16, 125); chkSeries.Name = "chkSeries"; chkSeries.Size = new System.Drawing.Size(56, 16); chkSeries.TabIndex = 5; chkSeries.Text = "Series:"; chkSeries.UseVisualStyleBackColor = true; cboDefaultSeries.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); cboDefaultSeries.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; cboDefaultSeries.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; cboDefaultSeries.FormattingEnabled = true; cboDefaultSeries.Location = new System.Drawing.Point(104, 122); cboDefaultSeries.Name = "cboDefaultSeries"; cboDefaultSeries.Size = new System.Drawing.Size(188, 21); cboDefaultSeries.TabIndex = 6; chkGroup.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); chkGroup.AutoSize = true; chkGroup.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); chkGroup.Location = new System.Drawing.Point(16, 91); chkGroup.Name = "chkGroup"; chkGroup.Size = new System.Drawing.Size(55, 16); chkGroup.TabIndex = 3; chkGroup.Text = "Group:"; chkGroup.UseVisualStyleBackColor = true; cboDefaultGroup.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); cboDefaultGroup.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; cboDefaultGroup.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; cboDefaultGroup.FormattingEnabled = true; cboDefaultGroup.Location = new System.Drawing.Point(104, 88); cboDefaultGroup.Name = "cboDefaultGroup"; cboDefaultGroup.Size = new System.Drawing.Size(188, 21); cboDefaultGroup.TabIndex = 4; cboDefaultGroup.SelectedIndexChanged += new System.EventHandler(cboDefaultGroup_SelectedIndexChanged); chkPublisher.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); chkPublisher.AutoSize = true; chkPublisher.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); chkPublisher.Location = new System.Drawing.Point(17, 55); chkPublisher.Name = "chkPublisher"; chkPublisher.Size = new System.Drawing.Size(72, 16); chkPublisher.TabIndex = 1; chkPublisher.Text = "Publisher:"; chkPublisher.UseVisualStyleBackColor = true; cboDefaultPublisher.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); cboDefaultPublisher.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; cboDefaultPublisher.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; cboDefaultPublisher.FormattingEnabled = true; cboDefaultPublisher.Location = new System.Drawing.Point(104, 52); cboDefaultPublisher.Name = "cboDefaultPublisher"; cboDefaultPublisher.Size = new System.Drawing.Size(188, 21); cboDefaultPublisher.TabIndex = 2; cboDefaultPublisher.SelectedIndexChanged += new System.EventHandler(cboDefaultPublisher_SelectedIndexChanged); TabPage3.Controls.Add(cmdBuffer); TabPage3.Controls.Add(label8); TabPage3.Controls.Add(cmdOption); TabPage3.Controls.Add(cmdConvert); TabPage3.Controls.Add(cmdPublisher); TabPage3.Controls.Add(cmdGroup); TabPage3.Controls.Add(cmdIssue); TabPage3.Controls.Add(cmdPlot); TabPage3.Controls.Add(cmdSeries); TabPage3.Controls.Add(cmdVolume); TabPage3.Controls.Add(txtKeywords); TabPage3.Location = new System.Drawing.Point(4, 22); TabPage3.Name = "TabPage3"; TabPage3.Size = new System.Drawing.Size(320, 240); TabPage3.TabIndex = 2; TabPage3.Text = "Keywords"; TabPage3.UseVisualStyleBackColor = true; cmdBuffer.Location = new System.Drawing.Point(74, 133); cmdBuffer.Name = "cmdBuffer"; cmdBuffer.Size = new System.Drawing.Size(80, 23); cmdBuffer.TabIndex = 13; cmdBuffer.Text = "Buffer"; cmdBuffer.UseVisualStyleBackColor = true; cmdBuffer.Click += new System.EventHandler(cmdBuffer_Click); label8.AutoSize = true; label8.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); label8.Location = new System.Drawing.Point(17, 11); label8.Name = "label8"; label8.Size = new System.Drawing.Size(279, 24); label8.TabIndex = 12; label8.Text = "If your comic files are similarly named, this will enable \r\nyou to create a pattern to match each filename."; label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; cmdOption.Location = new System.Drawing.Point(160, 133); cmdOption.Name = "cmdOption"; cmdOption.Size = new System.Drawing.Size(79, 23); cmdOption.TabIndex = 7; cmdOption.Text = "Optional Tag"; cmdOption.UseVisualStyleBackColor = true; cmdOption.Click += new System.EventHandler(cmdOption_Click); cmdConvert.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); cmdConvert.Location = new System.Drawing.Point(80, 197); cmdConvert.Name = "cmdConvert"; cmdConvert.Size = new System.Drawing.Size(159, 23); cmdConvert.TabIndex = 9; cmdConvert.Text = "Convert to Regular Expression"; cmdConvert.UseVisualStyleBackColor = true; cmdConvert.Click += new System.EventHandler(cmdConvert_Click); cmdPublisher.Location = new System.Drawing.Point(59, 49); cmdPublisher.Name = "cmdPublisher"; cmdPublisher.Size = new System.Drawing.Size(95, 22); cmdPublisher.TabIndex = 1; cmdPublisher.Text = "Publisher"; cmdPublisher.UseVisualStyleBackColor = true; cmdPublisher.Click += new System.EventHandler(cmdPublisher_Click); cmdGroup.Location = new System.Drawing.Point(160, 49); cmdGroup.Name = "cmdGroup"; cmdGroup.Size = new System.Drawing.Size(95, 22); cmdGroup.TabIndex = 2; cmdGroup.Text = "Group"; cmdGroup.UseVisualStyleBackColor = true; cmdGroup.Click += new System.EventHandler(cmdGroup_Click); cmdIssue.Location = new System.Drawing.Point(59, 105); cmdIssue.Name = "cmdIssue"; cmdIssue.Size = new System.Drawing.Size(95, 22); cmdIssue.TabIndex = 5; cmdIssue.Text = "Issue Number"; cmdIssue.UseVisualStyleBackColor = true; cmdIssue.Click += new System.EventHandler(cmdIssue_Click); cmdPlot.AccessibleDescription = ""; cmdPlot.Location = new System.Drawing.Point(160, 105); cmdPlot.Name = "cmdPlot"; cmdPlot.Size = new System.Drawing.Size(95, 22); cmdPlot.TabIndex = 6; cmdPlot.Text = "Plot Title"; cmdPlot.UseVisualStyleBackColor = true; cmdPlot.Click += new System.EventHandler(cmdPlot_Click); cmdSeries.Location = new System.Drawing.Point(59, 77); cmdSeries.Name = "cmdSeries"; cmdSeries.Size = new System.Drawing.Size(95, 22); cmdSeries.TabIndex = 3; cmdSeries.Text = "Series Name"; cmdSeries.UseVisualStyleBackColor = true; cmdSeries.Click += new System.EventHandler(cmdSeries_Click); cmdVolume.Location = new System.Drawing.Point(160, 77); cmdVolume.Name = "cmdVolume"; cmdVolume.Size = new System.Drawing.Size(95, 22); cmdVolume.TabIndex = 4; cmdVolume.Text = "Series Volume"; cmdVolume.UseVisualStyleBackColor = true; cmdVolume.Click += new System.EventHandler(cmdVolume_Click); txtKeywords.Location = new System.Drawing.Point(19, 171); txtKeywords.Name = "txtKeywords"; txtKeywords.Size = new System.Drawing.Size(277, 20); txtKeywords.TabIndex = 8; TabPage2.Controls.Add(udRegexIssue); TabPage2.Controls.Add(udRegexPlot); TabPage2.Controls.Add(udRegexVolume); TabPage2.Controls.Add(udRegexSeries); TabPage2.Controls.Add(udRegexGroup); TabPage2.Controls.Add(udRegexPublisher); TabPage2.Controls.Add(cboPresets); TabPage2.Controls.Add(cboTest); TabPage2.Controls.Add(cmdTest); TabPage2.Controls.Add(txtPattern); TabPage2.Controls.Add(Label2); TabPage2.Controls.Add(Label4); TabPage2.Controls.Add(Label5); TabPage2.Controls.Add(Label6); TabPage2.Controls.Add(Label3); TabPage2.Controls.Add(Label7); TabPage2.Controls.Add(label9); TabPage2.Location = new System.Drawing.Point(4, 22); TabPage2.Name = "TabPage2"; TabPage2.Padding = new System.Windows.Forms.Padding(3); TabPage2.Size = new System.Drawing.Size(320, 240); TabPage2.TabIndex = 1; TabPage2.Text = "Regular Expression"; TabPage2.UseVisualStyleBackColor = true; udRegexIssue.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); udRegexIssue.Location = new System.Drawing.Point(188, 169); udRegexIssue.Maximum = new decimal(new int[4] { 99, 0, 0, 0 }); udRegexIssue.Minimum = new decimal(new int[4] { 1, 0, 0, -2147483648 }); udRegexIssue.Name = "udRegexIssue"; udRegexIssue.Size = new System.Drawing.Size(42, 20); udRegexIssue.TabIndex = 25; udRegexIssue.Value = new decimal(new int[4] { 1, 0, 0, -2147483648 }); udRegexPlot.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); udRegexPlot.Location = new System.Drawing.Point(188, 148); udRegexPlot.Maximum = new decimal(new int[4] { 99, 0, 0, 0 }); udRegexPlot.Minimum = new decimal(new int[4] { 1, 0, 0, -2147483648 }); udRegexPlot.Name = "udRegexPlot"; udRegexPlot.Size = new System.Drawing.Size(42, 20); udRegexPlot.TabIndex = 24; udRegexPlot.Value = new decimal(new int[4] { 1, 0, 0, -2147483648 }); udRegexVolume.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); udRegexVolume.Location = new System.Drawing.Point(188, 126); udRegexVolume.Maximum = new decimal(new int[4] { 99, 0, 0, 0 }); udRegexVolume.Minimum = new decimal(new int[4] { 1, 0, 0, -2147483648 }); udRegexVolume.Name = "udRegexVolume"; udRegexVolume.Size = new System.Drawing.Size(42, 20); udRegexVolume.TabIndex = 23; udRegexVolume.Value = new decimal(new int[4] { 1, 0, 0, -2147483648 }); udRegexSeries.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); udRegexSeries.Location = new System.Drawing.Point(75, 169); udRegexSeries.Maximum = new decimal(new int[4] { 99, 0, 0, 0 }); udRegexSeries.Minimum = new decimal(new int[4] { 1, 0, 0, -2147483648 }); udRegexSeries.Name = "udRegexSeries"; udRegexSeries.Size = new System.Drawing.Size(42, 20); udRegexSeries.TabIndex = 22; udRegexSeries.Value = new decimal(new int[4] { 1, 0, 0, -2147483648 }); udRegexGroup.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); udRegexGroup.Location = new System.Drawing.Point(75, 148); udRegexGroup.Maximum = new decimal(new int[4] { 99, 0, 0, 0 }); udRegexGroup.Minimum = new decimal(new int[4] { 1, 0, 0, -2147483648 }); udRegexGroup.Name = "udRegexGroup"; udRegexGroup.Size = new System.Drawing.Size(42, 20); udRegexGroup.TabIndex = 21; udRegexGroup.Value = new decimal(new int[4] { 1, 0, 0, -2147483648 }); udRegexPublisher.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); udRegexPublisher.Location = new System.Drawing.Point(75, 126); udRegexPublisher.Maximum = new decimal(new int[4] { 99, 0, 0, 0 }); udRegexPublisher.Minimum = new decimal(new int[4] { 1, 0, 0, -2147483648 }); udRegexPublisher.Name = "udRegexPublisher"; udRegexPublisher.Size = new System.Drawing.Size(42, 20); udRegexPublisher.TabIndex = 20; udRegexPublisher.Value = new decimal(new int[4] { 1, 0, 0, -2147483648 }); cboPresets.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); cboPresets.FormattingEnabled = true; cboPresets.Location = new System.Drawing.Point(16, 28); cboPresets.Name = "cboPresets"; cboPresets.Size = new System.Drawing.Size(281, 21); cboPresets.Sorted = true; cboPresets.TabIndex = 16; cboPresets.SelectedIndexChanged += new System.EventHandler(cboPresets_SelectedIndexChanged); cboTest.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); cboTest.FormattingEnabled = true; cboTest.Location = new System.Drawing.Point(16, 202); cboTest.Name = "cboTest"; cboTest.Size = new System.Drawing.Size(222, 21); cboTest.TabIndex = 8; label9.AutoSize = true; label9.Font = new System.Drawing.Font("Verdana", 6.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); label9.Location = new System.Drawing.Point(14, 13); label9.Name = "label9"; label9.Size = new System.Drawing.Size(288, 12); label9.TabIndex = 19; label9.Text = "More advanced users can input their own regex patterns."; base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.ClientSize = new System.Drawing.Size(349, 323); base.Controls.Add(tabImport); base.Controls.Add(TableLayoutPanel1); base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "ImportForm"; base.ShowInTaskbar = false; base.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; Text = "Import Auto-Tag"; base.Load += new System.EventHandler(ImportForm_Load); TableLayoutPanel1.ResumeLayout(false); tabImport.ResumeLayout(false); TabPage1.ResumeLayout(false); TabPage1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)udDefaultVolume).EndInit(); TabPage3.ResumeLayout(false); TabPage3.PerformLayout(); TabPage2.ResumeLayout(false); TabPage2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)udRegexIssue).EndInit(); ((System.ComponentModel.ISupportInitialize)udRegexPlot).EndInit(); ((System.ComponentModel.ISupportInitialize)udRegexVolume).EndInit(); ((System.ComponentModel.ISupportInitialize)udRegexSeries).EndInit(); ((System.ComponentModel.ISupportInitialize)udRegexGroup).EndInit(); ((System.ComponentModel.ISupportInitialize)udRegexPublisher).EndInit(); ResumeLayout(false); }
private void Txt_GotFocus(object sender, EventArgs e) { TextBox txt = (TextBox)sender; txt.SelectAll(); }
private void textDelegate(TextBox p_objTextbox, string p_strCommand) { p_objTextbox.Text = p_strCommand; }
//</SnippetCommandingOverviewCommandDefinition> public Window1() { InitializeComponent(); //<SnippetCommandingOverviewKeyBinding> KeyGesture OpenKeyGesture = new KeyGesture( Key.B, ModifierKeys.Control); KeyBinding OpenCmdKeybinding = new KeyBinding( ApplicationCommands.Open, OpenKeyGesture); this.InputBindings.Add(OpenCmdKeybinding); //</SnippetCommandingOverviewKeyBinding> //<SnippetCommandingOverviewKeyGestureOnCmd> KeyGesture OpenCmdKeyGesture = new KeyGesture( Key.B, ModifierKeys.Control); ApplicationCommands.Open.InputGestures.Add(OpenCmdKeyGesture); //</SnippetCommandingOverviewKeyGestureOnCmd> //<SnippetCommandingOverviewCommandTargetCodeBehind> // Creating the UI objects StackPanel mainStackPanel = new StackPanel(); TextBox pasteTextBox = new TextBox(); Menu stackPanelMenu = new Menu(); MenuItem pasteMenuItem = new MenuItem(); // Adding objects to the panel and the menu stackPanelMenu.Items.Add(pasteMenuItem); mainStackPanel.Children.Add(stackPanelMenu); mainStackPanel.Children.Add(pasteTextBox); // Setting the command to the Paste command pasteMenuItem.Command = ApplicationCommands.Paste; // Setting the command target to the TextBox pasteMenuItem.CommandTarget = pasteTextBox; //</SnippetCommandingOverviewCommandTargetCodeBehind> //<SnippetCommandingOverviewCustomCommandSourceCodeBehind> // create the ui StackPanel CustomCommandStackPanel = new StackPanel(); Button CustomCommandButton = new Button(); CustomCommandStackPanel.Children.Add(CustomCommandButton); CustomCommandButton.Command = CustomRoutedCommand; //</SnippetCommandingOverviewCustomCommandSourceCodeBehind> //<SnippetCommandingOverviewCustomCommandBindingCodeBehind> CommandBinding customCommandBinding = new CommandBinding( CustomRoutedCommand, ExecutedCustomCommand, CanExecuteCustomCommand); // attach CommandBinding to root window this.CommandBindings.Add(customCommandBinding); //</SnippetCommandingOverviewCustomCommandBindingCodeBehind> sp.Children.Add(mainStackPanel); pasteTextBox.Background = Brushes.Bisque; sp.Children.Add(CustomCommandStackPanel); //<SnippetCommandingOverviewCmdSource> StackPanel cmdSourcePanel = new StackPanel(); ContextMenu cmdSourceContextMenu = new ContextMenu(); MenuItem cmdSourceMenuItem = new MenuItem(); // Add ContextMenu to the StackPanel. cmdSourcePanel.ContextMenu = cmdSourceContextMenu; cmdSourcePanel.ContextMenu.Items.Add(cmdSourceMenuItem); // Associate Command with MenuItem. cmdSourceMenuItem.Command = ApplicationCommands.Properties; //</SnippetCommandingOverviewCmdSource> cmdSourcePanel.Background = Brushes.Black; cmdSourcePanel.Height = 100; cmdSourcePanel.Width = 100; mainStackPanel.Children.Add(cmdSourcePanel); }
private void Txt_LostFocus(object sender, EventArgs e) { TextBox txt = (TextBox)sender; if (txt.Text.Equals("")) txt.Text = "0"; }
public TextBoxPanel() { var tb1 = new TextBox { Text = "Option 1", Left = 10, Top = 10, Width = 150, Placeholder = "Type Here" }; Controls.Add(tb1); var tb2 = new TextBox { Left = 10, Top = 50, Width = 150, Placeholder = "Type Here" }; Controls.Add(tb2); var tb3 = new TextBox { Left = 10, Top = 90, Width = 150, Text = "Read Only", ReadOnly = true }; Controls.Add(tb3); var tb4 = new TextBox { Left = 10, Top = 130, Width = 300, Height = 56, Text = "Not\nMultiline", }; Controls.Add(tb4); var tb5 = new TextBox { Left = 10, Top = 200, Width = 300, Height = 100, Text = "The quick brown fox\njumped over the lazy\ndogs.", MultiLine = true }; Controls.Add(tb5); var tb6 = new TextBox { Text = "With Padding", Left = 200, Top = 10, Width = 150, Padding = new Padding(5) }; Controls.Add(tb6); }
public TextBoxWriter(TextBox box) { _output = box; }