Jump to content
  • Advertisement
Sign in to follow this  
annoyer101

help with simple VB problem

This topic is 4381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
I think the correct method is RadioButton1.Checked :)

Edit: Dim hey As Boolean = RadioButton1.Checked

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!