11/14/2018; 2 minutes to read; In this article. groupBox1.Text = "MyGroupBox" groupBox1.Dock = DockStyle.Top ' Disable the GroupBox (which disables all its child controls) groupBox1.Enabled = False ' Add the Groupbox to the form. … Dim groupBox1 As New GroupBox() Dim textBox1 As New TextBox() textBox1.Location = New Point(15, 15) groupBox1.Controls.Add(textBox1) ' Set the Text and Dock properties of the GroupBox. The problem is that when the textboxes are disabled, the colour of the text within them goes grey and makes it hard to read (I need the users to be able to see the textbox contents very clearly, even when disabled). This example exposes each property independently with a CheckBox, so you observe the settings individually and combined.. If they select the other, it enables all the textboxes.

The following example demonstrates the Enabled and Locked properties and how they complement each other. CheckBox control, Enabled, Locked properties example. This example also includes a second TextBox so …