05-03-2013, 02:41 PM
Well, what you can actually do is create a method that checks all of the textbox's text contents, and if they are all empty, set the button's visible property to false.
This can be done like so:
[code2=vbnet]Public Sub CheckForText() Handles KryptonTextBox1.TextChanged, KryptonTextBox2.TextChanged, KryptonTextBox3.TextChanged, KryptonTextBox4.TextChanged
'this will be called anytime the textbox's text is changed
If (KryptonTextBox1.Text Is Nothing) Then 'the user didn't type in text for this box
KryptonButton1.Visible = False 'set the button to be invisible
Return 'exit the sub since we don't need to do anything else
ElseIf (KryptonTextBox2.Text Is Nothing) Then
KryptonButton1.Visible = False
Return
ElseIf (KryptonTextBox3.Text Is Nothing) Then
KryptonButton1.Visible = False
Return
ElseIf (KryptonTextBox4.Text Is Nothing) Then
KryptonButton1.Visible = False
Return
Else
KryptonButton1.Visible = True
Return
End If
End Sub[/code2]
Essentially, this sub will be called anytime any of those four textbox's text is changed, and if there is no text entered, the button will become invisible. If this is not the case and all textboxes have text, the button will be visible.
Hopefully this makes sense.
This can be done like so:
[code2=vbnet]Public Sub CheckForText() Handles KryptonTextBox1.TextChanged, KryptonTextBox2.TextChanged, KryptonTextBox3.TextChanged, KryptonTextBox4.TextChanged
'this will be called anytime the textbox's text is changed
If (KryptonTextBox1.Text Is Nothing) Then 'the user didn't type in text for this box
KryptonButton1.Visible = False 'set the button to be invisible
Return 'exit the sub since we don't need to do anything else
ElseIf (KryptonTextBox2.Text Is Nothing) Then
KryptonButton1.Visible = False
Return
ElseIf (KryptonTextBox3.Text Is Nothing) Then
KryptonButton1.Visible = False
Return
ElseIf (KryptonTextBox4.Text Is Nothing) Then
KryptonButton1.Visible = False
Return
Else
KryptonButton1.Visible = True
Return
End If
End Sub[/code2]
Essentially, this sub will be called anytime any of those four textbox's text is changed, and if there is no text entered, the button will become invisible. If this is not the case and all textboxes have text, the button will be visible.
Hopefully this makes sense.