help with simple VB problem
Hello. I need some help with a Visual Basic 2005 express program. I've only learned a little about VB so when trying to do something i wasn't 100% sure on i encountered a problem. In other words, this code won't run the program properly:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hi As String = TextBox1.Text
Dim hey As Boolean = RadioButton1.CanSelect
If (hey = False) Then
MessageBox.Show(hi)
ElseIf (hey = True) Then
MessageBox.Show(" ")
End If
End Sub
End Class
(this program has a textbox, a button below that, and a radiobutton below that, The button is used to open a messagebox that displays the text in the textbox, and if the radiobutton is selected, the text should not show in the messagebox when the regular button is pressed. However, when I type in the textbox, and press then button, then messagebox will be blank wheter i select the radiobutton or not.)
Any help with this problem is greatily appreciated. Thank You.
I think the correct method is RadioButton1.Checked :)
Edit: Dim hey As Boolean = RadioButton1.Checked
Edit: Dim hey As Boolean = RadioButton1.Checked
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement