Create a randomize text value in radiobutton?

ray_jenny1810

Member
Joined
Jan 17, 2010
Messages
9
Programming Experience
Beginner
Anyone knows how to randomize the radio button text value? with every click of the button?

ex.

radiobutton1.text="circle"
radiobutton2.text="triangle"
radiobutton3.text="rectangle"
radiobutton4.text="ellipse"


**will randomize into

radiobutton1.text="ellipse"
radiobutton2.text="circle"
radiobutton3.text="triangle"
radiobutton4.text="rectangle"


**as so on..


does anyone knows it?


thanks...
 
VB.NET:
Dim shapes As String() = {"circle", "triangle", "rectangle", "ellipse"}

'Randomise the array.
shapes = (From s In shapes _
          Let r = New Random _
          Order By r.NextDouble() _
          Select s).ToArray()

Me.RadioButton1.Text = shapes(0)
Me.RadioButton2.Text = shapes(1)
Me.RadioButton3.Text = shapes(2)
Me.RadioButton4.Text = shapes(3)
 
Hmmm... slight adjustment necessary:
VB.NET:
Dim shapes As String() = {"circle", "triangle", "rectangle", "ellipse"}
Dim rng As New Random

'Randomise the array.
shapes = (From s In shapes _
          Order By rng.NextDouble() _
          Select s).ToArray()

Me.RadioButton1.Text = shapes(0)
Me.RadioButton2.Text = shapes(1)
Me.RadioButton3.Text = shapes(2)
Me.RadioButton4.Text = shapes(3)
 
Textbox value = radiobutton choices

hi.. is there anyone knows how to get the randomize the question and answer choices?


ex..


**question is in the textbox.text format

question : what is pentagon?

**answer or choices will be on radiobutton format

radiobutton1.text="3 sided polygon"
radiobutton2.text="4 sided polygon"
radiobutton3.text="5 sided polygon"
radiobutton4.text="6 sided polygon"

after that.. the question will get randomize and the choices will rely depending on the value of the question on the textbox..


thanks..
 
need help in randomize method

anyone knows how to do this?


question: what is pentagon? (in textbox form)

choices: (in radio button format)
a: 5 sided polygon
b: 6 sided polygon
c: 7 sided polygon
d: 8 sided polygon

after that, next question will appear..

and the choices in that question will be the choices in the radiobutton..

is that possible?
 
You seem to repeat asking the same question over and over ...
And I can't see any "method" in your question, except for the thread title.

You should first start with exactly defining your problem. From your last questions it looks like:
I have several questions with multiple answers of which only one is correct. The answers should be shown as text of radiobuttons and in random order.
The questions should be shown in random order too and no question should be shown twice.

Is this, what you want to achieve?
 
hmmm..

i dont know what is the exact term for that.. all i want to do is this..


the question will be relying depends on the choices.. example:


Q1:what is pentagon?

choices1:
[a] 5 sided polygon
6 sided polygon
[c] 7 sided polygon
[d] 8 sided polygon


after that, it will randomize... and the next question will appear in the same textbox and the choices will be put in the radiobuttons...


Q2: what is triangle?

choices1:
[a] 3 sided polygon
4 sided polygon
[c] 5 sided polygon
[d] 6 sided polygon


and it will randomize..
 
Back
Top