Hi everyone! How to disable a textbox and combo box by coding not by changing their properties?

Recommended Answers

All 3 Replies

Impossible.
If you want to disable a control, you have to use "Enabled" property of a control. And it must be set to false.
Or you can even use "ReadOnly" property, which has to be set to true (to be disabled).

like this ?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    TextBox1.Enabled = False
    ComboBox1.Enabled = False
End Sub

like this ?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    TextBox1.Enabled = False
    ComboBox1.Enabled = False
End Sub

Exactly!! thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.