title: VB 2010 Textboxes And Buttons Enabled/Disabled
body: <p>i have one more question about a project in my visual basic 2010. i have 2 textboxes, one button and one progress bar. You have to type username (in tb1) and a random password (in tb2) so the button is enabled and the progress bar starts if i press it. I want the button to be disabled if i havent written any text in the textboxes and enabled if i have. I tried this code but it doesnt work.</p>
  
  <pre><code>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 
          If TextBox1.Text &lt;&gt; "" And TextBox2.Text &lt;&gt; "" Then
              Button1.Enabled = True
          ElseIf Button1.Enabled = False Then
              MsgBox("Progress Fail.", MsgBoxStyle.Exclamation)
          End If
      End Sub
  </code></pre>
  
  <p>Have you any ideas on how can i solve this? Thanks for help</p>
  
  <p>I added a list with radio buttons too. now i want button1 to be enabled if i choose one item from the radio buttons too. Thanks again</p>