GrapeCity.Win.Containers 名前空間 > RadioButtonItem クラス : Clone メソッド |
public void CreateMyGcRadioGroupBox() { GcRadioGroupBox gcRadioGroupBox1 = new GcRadioGroupBox(); gcRadioGroupBox1.Location = new Point(15, 15); gcRadioGroupBox1.Text = "MyGcRadioGroupBox"; // Create an item. RadioButtonItem item = new RadioButtonItem(); // Set the Text of RadioButtonItem. item.Text = "MyRadioButtonItem"; // Set a new Font from the existing font. item.Font = new Font(item.Font, FontStyle.Bold); // Set the BackColor and ForeColor properties for RadioButtonItem. item.BackColor = Color.LightGreen; item.ForeColor = Color.LightPink; // Disable the item. item.Enabled = false; gcRadioGroupBox1.LayoutSettings.LayoutMode = LayoutMode.Absolute; // Set the location of the item. item.Location = new Point(15, 15); // Clone an item, modify its location and change its Enabled to true to enable the UI interaction. RadioButtonItem clonedItem = item.Clone() as RadioButtonItem; clonedItem.Location = new Point(15, 40); clonedItem.Enabled = true; gcRadioGroupBox1.Items.Add(item); gcRadioGroupBox1.Items.Add(clonedItem); this.Controls.Add(gcRadioGroupBox1); }
Public Sub CreateMyGcRadioGroupBox() Dim gcRadioGroupBox1 As New GcRadioGroupBox() gcRadioGroupBox1.Location = New Point(15, 15) gcRadioGroupBox1.Text = "MyGcRadioGroupBox" ' Create an item. Dim item As New RadioButtonItem() ' Set the Text of RadioButtonItem. item.Text = "MyRadioButtonItem" ' Set a new Font from the existing font. item.Font = New Font(item.Font, FontStyle.Bold) ' Set the BackColor and ForeColor properties for RadioButtonItem. item.BackColor = Color.LightGreen item.ForeColor = Color.LightPink ' Disable the item. item.Enabled = False gcRadioGroupBox1.LayoutSettings.LayoutMode = LayoutMode.Absolute ' Set the location of the item. item.Location = New Point(15, 15) ' Clone an item, modify its location and change its Enabled to true to enable the UI interaction. Dim clonedItem As RadioButtonItem = TryCast(item.Clone(), RadioButtonItem) clonedItem.Location = New Point(15, 40) clonedItem.Enabled = True gcRadioGroupBox1.Items.Add(item) gcRadioGroupBox1.Items.Add(clonedItem) Me.Controls.Add(gcRadioGroupBox1) End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2