Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am working a project where I need 3 radio boxes

 

radiobox1 (Happy)

radiobox2 (sad)

radiobox3 (angry)

 

when radiobox1(happy) is clicked and generate (button1) pressed it generates a random number, based on that number a HAPPY sentence will be displayed in textbox1.text

 

If radiobox2 (sad) button1 will generate a SAD sentence. like wise for radiobox3 (angry)

 

This is what I have under each radiobox

 

' Randomize control for radiobox1

Randomize()

Dim A As Integer

A = Int(Rnd() * 5) + 1

If A = 1 Then TextBox1.Text = "happy 1"

If A = 2 Then TextBox1.Text = "Happy 2"

If A = 3 Then TextBox1.Text = "Happy 3"

If A = 4 Then TextBox1.Text = "Happy 4"

If A = 5 Then TextBox1.Text = "Happy 5"

' End Randomize control

 

The same applies for radiobox2 & 3 except that the sentence is either angry or sad.

 

Here is where I am stuck. I cannot firgure how to get button1 (Generate) to start the process.

 

I am new to vb.net and have 2 books, I have tried different things including if, elseif.

 

I am just brain dead.

Posted

this is where I'm at

 

I wrote this code into the button1 field

 

If RadioButton1.Checked = True Then TextBox1.Text = ("box1")

 

If RadioButton2.Checked = True Then TextBox1.Text = ("box2")

 

If RadioButton3.Checked = True Then TextBox1.Text = ("box3")

 

I am trying to get the sub routine to work with this

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...