/// <summary> /// Initializes the designer with the specified component. /// </summary> /// <param name="component">The IComponent to associate the designer with.</param> public override void Initialize(IComponent component) { Debug.Assert(component != null); // Validate the parameter reference if (component == null) { throw new ArgumentNullException(nameof(component)); } // Let base class do standard stuff base.Initialize(component); // Cast to correct type _groupBox = component as KryptonGroupBox; // The resizing handles around the control need to change depending on the // value of the AutoSize and AutoSizeMode properties. When in AutoSize you // do not get the resizing handles, otherwise you do. AutoResizeHandles = true; // Acquire service interfaces _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost)); // Let the internal panel in the container be designable if (_groupBox != null) { EnableDesignMode(_groupBox.Panel, "Panel"); } }
/// <summary> /// Initialize a new instance of the KryptonGroupBoxDesigner class. /// </summary> /// <param name="owner">Designer that owns this action list instance.</param> public KryptonGroupBoxActionList(KryptonGroupBoxDesigner owner) : base(owner.Component) { // Remember the control instance _groupBox = owner.Component as KryptonGroupBox; // Cache service used to notify when a property has changed _service = (IComponentChangeService)GetService(typeof(IComponentChangeService)); }
/// <summary> /// Initializes the Form's components. /// </summary> private void InitializeComponent() { components = new Container(); _byteViewer = new KryptonByteViewer(); KryptonPanel bottomPanel = new KryptonPanel(); KryptonPanel topPanel = new KryptonPanel(); KryptonGroupBox groupBox = new KryptonGroupBox(); KryptonCheckButton unicodeButton = new KryptonCheckButton(); KryptonCheckButton hexButton = new KryptonCheckButton(); KryptonCheckButton ansiButton = new KryptonCheckButton(); KryptonCheckButton export = new KryptonCheckButton(); KryptonCheckSet displayModeCheckset = new KryptonCheckSet(components); ((ISupportInitialize)(topPanel)).BeginInit(); topPanel.SuspendLayout(); ((ISupportInitialize)(groupBox)).BeginInit(); groupBox.Panel.BeginInit(); groupBox.Panel.SuspendLayout(); groupBox.SuspendLayout(); ((ISupportInitialize)(displayModeCheckset)).BeginInit(); ((ISupportInitialize)(bottomPanel)).BeginInit(); SuspendLayout(); // // topPanel // topPanel.AutoSize = true; topPanel.Controls.Add(groupBox); topPanel.Controls.Add(export); topPanel.Dock = DockStyle.Top; topPanel.Location = new System.Drawing.Point(0, 0); topPanel.Name = "topPanel"; topPanel.Padding = new Padding(5); topPanel.Size = new System.Drawing.Size(639, 65); topPanel.TabIndex = 0; // // groupBox // groupBox.AutoSize = true; groupBox.Location = new System.Drawing.Point(5, 0); groupBox.Name = "groupBox"; // // groupBox.Panel // groupBox.Panel.Controls.Add(unicodeButton); groupBox.Panel.Controls.Add(hexButton); groupBox.Panel.Controls.Add(ansiButton); groupBox.Size = new System.Drawing.Size(280, 57); groupBox.TabIndex = 0; groupBox.Values.Heading = @"Display Mode"; // // unicodeButton // unicodeButton.Location = new System.Drawing.Point(141, 3); unicodeButton.Name = "unicodeButton"; unicodeButton.Size = new System.Drawing.Size(63, 25); unicodeButton.TabIndex = 3; unicodeButton.Values.Text = @"Unicode"; // // hexButton // hexButton.Checked = true; hexButton.Location = new System.Drawing.Point(3, 3); hexButton.Name = "hexButton"; hexButton.Size = new System.Drawing.Size(63, 25); hexButton.TabIndex = 2; hexButton.Values.Text = @"Hex"; // // ansiButton // ansiButton.Location = new System.Drawing.Point(72, 3); ansiButton.Name = "ansiButton"; ansiButton.Size = new System.Drawing.Size(63, 25); ansiButton.TabIndex = 1; ansiButton.Values.Text = @"ANSI"; // // displayModeCheckset // displayModeCheckset.CheckButtons.Add(ansiButton); displayModeCheckset.CheckButtons.Add(hexButton); displayModeCheckset.CheckButtons.Add(unicodeButton); displayModeCheckset.CheckedButton = hexButton; displayModeCheckset.CheckedButtonChanged += OnCheckedButtonChanged; // // export // export.Location = new System.Drawing.Point(535, 22); export.Name = "export"; export.Size = new System.Drawing.Size(80, 25); export.TabIndex = 4; export.Values.Text = @"Export..."; export.Click += OnClickExport; // // bottomPanel // bottomPanel.Dock = DockStyle.Fill; bottomPanel.Location = new System.Drawing.Point(0, 65); bottomPanel.Name = "bottomPanel"; bottomPanel.Size = new System.Drawing.Size(639, 401); bottomPanel.TabIndex = 1; bottomPanel.Controls.Add(_byteViewer); // // byteViewer // _byteViewer.Dock = DockStyle.Fill; _byteViewer.CellBorderStyle = TableLayoutPanelCellBorderStyle.None; // // Form1 // AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new System.Drawing.Size(639, 466); Controls.Add(bottomPanel); Controls.Add(topPanel); FormBorderStyle = FormBorderStyle.FixedToolWindow; StartPosition = FormStartPosition.CenterParent; Name = @"Binary Viewer"; Text = @"Binary Viewer"; ((ISupportInitialize)(topPanel)).EndInit(); topPanel.ResumeLayout(false); topPanel.PerformLayout(); groupBox.Panel.EndInit(); groupBox.Panel.ResumeLayout(false); ((ISupportInitialize)(groupBox)).EndInit(); groupBox.ResumeLayout(false); ((ISupportInitialize)(displayModeCheckset)).EndInit(); ((ISupportInitialize)(bottomPanel)).EndInit(); ResumeLayout(false); PerformLayout(); }