private void ChangeCasing() { var text = FindBox.Text; var location = FindBox.Location; var size = FindBox.Size; Controls.Remove(FindBox); if (HexRadio.Checked) { FindBox = new HexTextBox { CharacterCasing = CharacterCasing.Upper }; (FindBox as HexTextBox).Nullable = true; } else { FindBox = new TextBox { CharacterCasing = CharacterCasing.Normal }; } FindBox.Text = text; FindBox.Size = size; Controls.Add(FindBox); FindBox.Location = location; }
private void InitializeCustomComponents() { this.SuspendLayout(); // hexTextBox hexTextBox = new HexTextBox(); hexTextBox.Location = new Point( 376, 231 ); hexTextBox.Size = new Size( 55, 20 ); hexTextBox.BorderStyle = BorderStyle.FixedSingle; hexTextBox.ReadOnly = false; hexTextBox.KeyUp += new KeyEventHandler(hexTextBox_KeyUp); hexTextBox.KeyDown += new KeyEventHandler(hexTextBox_KeyDown); this.Controls.Add( hexTextBox ); // colorFieldPanel colorFieldPanel = new ColorFieldPanel(); colorFieldPanel.BackColor = System.Drawing.SystemColors.Desktop; colorFieldPanel.Location = new System.Drawing.Point(16, 8); colorFieldPanel.Name = "colorFieldPanel"; colorFieldPanel.Size = new System.Drawing.Size(256, 256); colorFieldPanel.TabIndex = 52; colorFieldPanel.ColorSelected += new ColorFieldPanel.ColorSelectedHandler(colorFieldPanel_ColorSelected); Controls.Add( colorFieldPanel ); // colorSwatchPanel colorSwatchPanel = new ColorSwatchPanel(); colorSwatchPanel.Location = new System.Drawing.Point(464, 4); colorSwatchPanel.Name = "colorSwatchPanel"; colorSwatchPanel.Size = new System.Drawing.Size(96, 264); colorSwatchPanel.TabIndex = 53; colorSwatchPanel.ColorSwatchSelected += new ColorSwatchSelectedHandler(colorSwatchPanel_ColorSwatchSelected); Controls.Add( colorSwatchPanel ); // rgbColorSpace rgbColorSpace = new RgbColorSpace(); rgbColorSpace.DisplayRadioButtons = true; rgbColorSpace.Location = new System.Drawing.Point(336, 138); rgbColorSpace.Name = "rgbColorSpace"; rgbColorSpace.ReadOnly = false; rgbColorSpace.Size = new System.Drawing.Size(112, 96); rgbColorSpace.TabIndex = 48; rgbColorSpace.ComponentValueChanged += new ColorSpaceEventHandler(ColorSpaceComponentValueChanged); rgbColorSpace.SelectedComponentChanged += new ColorSpaceEventHandler(SelectedColorSpaceComponentChanged); Controls.Add(rgbColorSpace); // hsbColorSpace hsbColorSpace = new HsbColorSpace(); hsbColorSpace.DisplayRadioButtons = true; hsbColorSpace.Location = new System.Drawing.Point(336, 58); hsbColorSpace.Name = "hsbColorSpace"; hsbColorSpace.ReadOnly = false; hsbColorSpace.Size = new System.Drawing.Size(112, 96); hsbColorSpace.TabIndex = 47; hsbColorSpace.ComponentValueChanged += new ColorSpaceEventHandler(ColorSpaceComponentValueChanged); hsbColorSpace.SelectedComponentChanged += new ColorSpaceEventHandler(SelectedColorSpaceComponentChanged); hsbColorSpace.SetDefaultSelection(); Controls.Add(hsbColorSpace); this.ResumeLayout( false ); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.grdData = new Bin.HexGrid(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.txtNumberOfBits = new System.Windows.Forms.TextBox(); this.txtBitPosition = new System.Windows.Forms.TextBox(); this.txtBytePosition = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.rbViewBits = new System.Windows.Forms.RadioButton(); this.rbViewDecimal = new System.Windows.Forms.RadioButton(); this.rbViewHex = new System.Windows.Forms.RadioButton(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.rbUnsigned = new System.Windows.Forms.RadioButton(); this.rbSigned = new System.Windows.Forms.RadioButton(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.txtValueInEditMode = new Bin.HexTextBox(); this.btnWriteData = new System.Windows.Forms.Button(); this.btnExit = new System.Windows.Forms.Button(); this.label4 = new System.Windows.Forms.Label(); this.txtInitialData = new System.Windows.Forms.TextBox(); this.btnFillGrid = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.grdData)).BeginInit(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); this.groupBox4.SuspendLayout(); this.SuspendLayout(); // // grdData // this.grdData.AccessibleName = "DataGrid"; this.grdData.AccessibleRole = System.Windows.Forms.AccessibleRole.Table; this.grdData.CaptionVisible = false; this.grdData.ColumnHeadersVisible = false; this.grdData.DataMember = ""; this.grdData.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.grdData.Location = new System.Drawing.Point(0, 72); this.grdData.Name = "grdData"; this.grdData.NumColumns = 16; this.grdData.PreferredColumnWidth = 25; this.grdData.RowHeadersVisible = false; this.grdData.RowHeaderWidth = 25; this.grdData.Size = new System.Drawing.Size(408, 144); this.grdData.TabIndex = 22; this.grdData.CurrentCellChanged += new System.EventHandler(this.grdData_CurrentCellChanged); // // groupBox1 // this.groupBox1.Controls.Add(this.txtNumberOfBits); this.groupBox1.Controls.Add(this.txtBitPosition); this.groupBox1.Controls.Add(this.txtBytePosition); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Location = new System.Drawing.Point(8, 224); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(128, 104); this.groupBox1.TabIndex = 17; this.groupBox1.TabStop = false; this.groupBox1.Text = "Byte Location"; // // txtNumberOfBits // this.txtNumberOfBits.Location = new System.Drawing.Point(88, 72); this.txtNumberOfBits.Name = "txtNumberOfBits"; this.txtNumberOfBits.Size = new System.Drawing.Size(24, 20); this.txtNumberOfBits.TabIndex = 5; this.txtNumberOfBits.Text = "8"; this.txtNumberOfBits.TextChanged += new System.EventHandler(this.txtNumberOfBits_TextChanged); // // txtBitPosition // this.txtBitPosition.Location = new System.Drawing.Point(88, 48); this.txtBitPosition.Name = "txtBitPosition"; this.txtBitPosition.Size = new System.Drawing.Size(24, 20); this.txtBitPosition.TabIndex = 4; this.txtBitPosition.Text = "0"; this.txtBitPosition.TextChanged += new System.EventHandler(this.txtBitPosition_TextChanged); // // txtBytePosition // this.txtBytePosition.Location = new System.Drawing.Point(88, 24); this.txtBytePosition.Name = "txtBytePosition"; this.txtBytePosition.Size = new System.Drawing.Size(24, 20); this.txtBytePosition.TabIndex = 3; this.txtBytePosition.Text = "00"; this.txtBytePosition.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtBytePosition_KeyPress); // // label3 // this.label3.Location = new System.Drawing.Point(8, 72); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(88, 16); this.label3.TabIndex = 2; this.label3.Text = "Number of Bits:"; // // label2 // this.label2.Location = new System.Drawing.Point(8, 48); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(64, 16); this.label2.TabIndex = 1; this.label2.Text = "Bit Position:"; // // label1 // this.label1.Location = new System.Drawing.Point(8, 24); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(80, 16); this.label1.TabIndex = 0; this.label1.Text = "Byte Position:"; // // groupBox2 // this.groupBox2.Controls.Add(this.rbViewBits); this.groupBox2.Controls.Add(this.rbViewDecimal); this.groupBox2.Controls.Add(this.rbViewHex); this.groupBox2.Location = new System.Drawing.Point(144, 224); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(112, 104); this.groupBox2.TabIndex = 18; this.groupBox2.TabStop = false; this.groupBox2.Text = "View Mode"; // // rbViewBits // this.rbViewBits.Location = new System.Drawing.Point(8, 72); this.rbViewBits.Name = "rbViewBits"; this.rbViewBits.Size = new System.Drawing.Size(88, 24); this.rbViewBits.TabIndex = 15; this.rbViewBits.Text = "View Bits"; this.rbViewBits.CheckedChanged += new System.EventHandler(this.rbViewBits_CheckedChanged); // // rbViewDecimal // this.rbViewDecimal.Location = new System.Drawing.Point(8, 48); this.rbViewDecimal.Name = "rbViewDecimal"; this.rbViewDecimal.Size = new System.Drawing.Size(96, 24); this.rbViewDecimal.TabIndex = 14; this.rbViewDecimal.Text = "View Decimal"; this.rbViewDecimal.CheckedChanged += new System.EventHandler(this.rbViewDecimal_CheckedChanged); // // rbViewHex // this.rbViewHex.Checked = true; this.rbViewHex.Location = new System.Drawing.Point(8, 24); this.rbViewHex.Name = "rbViewHex"; this.rbViewHex.Size = new System.Drawing.Size(88, 24); this.rbViewHex.TabIndex = 13; this.rbViewHex.TabStop = true; this.rbViewHex.Text = "View Hex"; this.rbViewHex.CheckedChanged += new System.EventHandler(this.rbViewHex_CheckedChanged); // // groupBox3 // this.groupBox3.Controls.Add(this.rbUnsigned); this.groupBox3.Controls.Add(this.rbSigned); this.groupBox3.Location = new System.Drawing.Point(264, 224); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(136, 104); this.groupBox3.TabIndex = 19; this.groupBox3.TabStop = false; this.groupBox3.Text = "Number"; // // rbUnsigned // this.rbUnsigned.Checked = true; this.rbUnsigned.Enabled = false; this.rbUnsigned.Location = new System.Drawing.Point(16, 32); this.rbUnsigned.Name = "rbUnsigned"; this.rbUnsigned.TabIndex = 18; this.rbUnsigned.TabStop = true; this.rbUnsigned.Text = "Unsigned Value"; this.rbUnsigned.CheckedChanged += new System.EventHandler(this.rbUnsigned_CheckedChanged); // // rbSigned // this.rbSigned.Enabled = false; this.rbSigned.Location = new System.Drawing.Point(16, 64); this.rbSigned.Name = "rbSigned"; this.rbSigned.TabIndex = 17; this.rbSigned.Text = "Signed Value"; this.rbSigned.CheckedChanged += new System.EventHandler(this.rbSigned_CheckedChanged); // // groupBox4 // this.groupBox4.Controls.Add(this.txtValueInEditMode); this.groupBox4.Location = new System.Drawing.Point(8, 336); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(392, 72); this.groupBox4.TabIndex = 20; this.groupBox4.TabStop = false; this.groupBox4.Text = "Bits in Edit Mode"; // // txtValueInEditMode // this.txtValueInEditMode.CurrentNumberMode = Bin.HexTextBox.NumberMode.Hex; this.txtValueInEditMode.Font = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.txtValueInEditMode.Location = new System.Drawing.Point(136, 16); this.txtValueInEditMode.Multiline = false; this.txtValueInEditMode.Name = "txtValueInEditMode"; this.txtValueInEditMode.NumberOfBits = 8; this.txtValueInEditMode.SignedNumber = false; this.txtValueInEditMode.Size = new System.Drawing.Size(240, 26); this.txtValueInEditMode.TabIndex = 0; this.txtValueInEditMode.Text = ""; // // btnWriteData // this.btnWriteData.Location = new System.Drawing.Point(0, 0); this.btnWriteData.Name = "btnWriteData"; this.btnWriteData.TabIndex = 0; // // btnExit // this.btnExit.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnExit.Location = new System.Drawing.Point(152, 416); this.btnExit.Name = "btnExit"; this.btnExit.TabIndex = 21; this.btnExit.Text = "EXIT"; this.btnExit.Click += new System.EventHandler(this.btnExit_Click); // // label4 // this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.label4.Location = new System.Drawing.Point(0, 4); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(288, 16); this.label4.TabIndex = 23; this.label4.Text = "Enter Hexadecimal string value to be edited:"; // // txtInitialData // this.txtInitialData.Location = new System.Drawing.Point(0, 24); this.txtInitialData.Name = "txtInitialData"; this.txtInitialData.Size = new System.Drawing.Size(300, 20); this.txtInitialData.TabIndex = 24; this.txtInitialData.Text = ""; // // btnFillGrid // this.btnFillGrid.Location = new System.Drawing.Point(328, 16); this.btnFillGrid.Name = "btnFillGrid"; this.btnFillGrid.Size = new System.Drawing.Size(75, 32); this.btnFillGrid.TabIndex = 25; this.btnFillGrid.Text = "Fill Grid"; this.btnFillGrid.Click += new System.EventHandler(this.btnFillGrid_Click); // // HexDlgForm // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(408, 446); this.Controls.Add(this.btnFillGrid); this.Controls.Add(this.txtInitialData); this.Controls.Add(this.label4); this.Controls.Add(this.btnExit); this.Controls.Add(this.groupBox4); this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Controls.Add(this.grdData); this.Name = "HexDlgForm"; this.Load += new System.EventHandler(this.HexDlgForm_Load); ((System.ComponentModel.ISupportInitialize)(this.grdData)).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox3.ResumeLayout(false); this.groupBox4.ResumeLayout(false); this.ResumeLayout(false); }
private void ChangeCasing() { var text = FindBox.Text; var location = FindBox.Location; var size = FindBox.Size; Controls.Remove(FindBox); if (HexRadio.Checked) { FindBox = new HexTextBox { CharacterCasing = CharacterCasing.Upper, Nullable = HexRadio.Checked, Text = text, Size = size, Location = location }; } else { FindBox = new TextBox { Text = text, Size = size, Location = location }; } Controls.Add(FindBox); }