ManagementGroupBox Class

Definition

Represents a frame around a group of related controls.

public ref class ManagementGroupBox : System::Windows::Forms::GroupBox
public class ManagementGroupBox : System.Windows.Forms.GroupBox
type ManagementGroupBox = class
    inherit GroupBox
Public Class ManagementGroupBox
Inherits GroupBox
Inheritance
ManagementGroupBox

Examples

The following example implements the methods and properties of the ManagementGroupBox class. The example creates a group box that contains controls that enable you to change the RightToLeftLayout property, create a custom CreateParams property, and create a custom OnRightToLeftChanged method. The wizard page is put into a WizardForm object.

using System;
using System.Windows.Forms;
using Microsoft.Web.Management.Client.Win32;

namespace ExtensibilityDemo
{
    public partial class PageManagementGroupBox : WizardPage
    {
        public PageManagementGroupBox()
        {
            InitializeComponent();
            // Set the initial label1 text to the RightToLeftLayout value.
            label1.Text = this.ManagementGroupBox1.RightToLeftLayout.ToString();
            Caption = "ManagementGroupBox";
        }

        // Enable the next button.page. 
        protected override bool CanNavigateNext
        {
            get
            {
                return true;
            }
        }
        // Create the customized OnRightToLeftchanged method.
        protected override void OnRightToLeftChanged(EventArgs e)
        {
            ShowMessage("Management group box RightToLeftLayout changed.");
        }
        // Create the customized CreateParams property.
        protected override CreateParams CreateParams
        {
            get
            {
                const int WS_EX_LAYOUTRTL = 0x400000;
                const int WS_EX_NOINHERITLAHYOUT = 0x100000;

                CreateParams CP;
                CP = base.CreateParams;
                CP.ExStyle = CP.ExStyle | WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAHYOUT;
                return CP;
            }
        }
        // The Change RightToLeftLayout button is clicked.
        private void button1_Click(object sender, EventArgs e)
        {
            this.ManagementGroupBox1.RightToLeftLayout = !this.ManagementGroupBox1.RightToLeftLayout;
            OnRightToLeftChanged(e);
            label1.Text = this.ManagementGroupBox1.RightToLeftLayout.ToString();
        }
        // The CreateParams button is clicked.
        private void button2_Click(object sender, EventArgs e)
        {
            label2.Text = this.CreateParams.ToString();
        }
    }
}
private void InitializeComponent()
{
    this.button1 = new System.Windows.Forms.Button();
    this.label1 = new System.Windows.Forms.Label();
    this.ManagementGroupBox1 = new Microsoft.Web.Management.Client.Win32.ManagementGroupBox();
    this.label2 = new System.Windows.Forms.Label();
    this.button2 = new System.Windows.Forms.Button();
    this.ManagementGroupBox1.SuspendLayout();
    this.SuspendLayout();
    // 
    // button1
    // 
    this.button1.Location = new System.Drawing.Point(19, 38);
    this.button1.Name = "button1";
    this.button1.Size = new System.Drawing.Size(164, 23);
    this.button1.TabIndex = 0;
    this.button1.Text = "Change right to left layout";
    this.button1.UseVisualStyleBackColor = true;
    this.button1.Click += new System.EventHandler(this.button1_Click);
    // 
    // label1
    // 
    this.label1.AutoSize = true;
    this.label1.Location = new System.Drawing.Point(203, 43);
    this.label1.Name = "label1";
    this.label1.Size = new System.Drawing.Size(35, 13);
    this.label1.TabIndex = 1;
    this.label1.Text = "label1";
    // 
    // ManagementGroupBox1
    // 
    this.ManagementGroupBox1.Controls.Add(this.label2);
    this.ManagementGroupBox1.Controls.Add(this.button2);
    this.ManagementGroupBox1.Controls.Add(this.button1);
    this.ManagementGroupBox1.Controls.Add(this.label1);
    this.ManagementGroupBox1.Location = new System.Drawing.Point(15, 22);
    this.ManagementGroupBox1.Name = "ManagementGroupBox1";
    this.ManagementGroupBox1.RightToLeftLayout = false;
    this.ManagementGroupBox1.Size = new System.Drawing.Size(528, 150);
    this.ManagementGroupBox1.TabIndex = 2;
    this.ManagementGroupBox1.TabStop = false;
    this.ManagementGroupBox1.Text = "ManagementGroupBox1";
    // 
    // label2
    // 
    this.label2.AutoSize = true;
    this.label2.Location = new System.Drawing.Point(203, 94);
    this.label2.Name = "label2";
    this.label2.Size = new System.Drawing.Size(35, 13);
    this.label2.TabIndex = 3;
    this.label2.Text = "label2";
    // 
    // button2
    // 
    this.button2.Location = new System.Drawing.Point(19, 89);
    this.button2.Name = "button2";
    this.button2.Size = new System.Drawing.Size(164, 23);
    this.button2.TabIndex = 4;
    this.button2.Text = "Create Params";
    this.button2.UseVisualStyleBackColor = true;
    this.button2.Click += new System.EventHandler(this.button2_Click);
    // 
    // PageManagementGroupBox
    // 
    this.Controls.Add(this.ManagementGroupBox1);
    this.Name = "PageManagementGroupBox";
    this.Size = new System.Drawing.Size(560, 200);
    this.ManagementGroupBox1.ResumeLayout(false);
    this.ManagementGroupBox1.PerformLayout();
    this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private Microsoft.Web.Management.Client.Win32.ManagementGroupBox ManagementGroupBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button button2;

Remarks

A ManagementGroupBox object displays a frame around a collection of related controls in a WizardPage object. This control resembles a System.Windows.Forms.GroupBox object.

Constructors

ManagementGroupBox()

Initializes a new instance of the ManagementGroupBox class.

Properties

CreateParams

Gets the required creation parameters when the management group box is created.

RightToLeftLayout

Gets or sets a value indicating whether right-to-left mirror placement is enabled.

Methods

OnRightToLeftChanged(EventArgs)

Provides a mechanism to perform an action when the RightToLeftLayout property changes.

Applies to

See also