[HELP] VB.NET simple help needed!
2014-11-12, 09:35 AM,
#1
Hello! I used to know this, but do not anymore since i took a break for a bit!

So i need it so when something happens, the text in textbox 1 is:
"text1"
or
"text2"
or
"text3"
or
"text4"

you get the point!

signature
Reply
2014-11-12, 01:48 PM,
#2
you want to make a keygen? with diferent keys?
Reply
2014-11-12, 02:32 PM,
(This post was last modified: 2014-11-12, 02:34 PM by CPA Puppy.)
#3
something like

Dim condition as Interger
If some condition = 1 then
textbox1.text = "Sometext"
ElseIf condition = 2 then
textbox1.text = "Sometext2"
Elseif condition = 3 then
texbox1.text = "sometext3"
.....
Else
Nothing
End if

Notes:
Else = Not condition 1,2,3,4,5,6 but something opposite or nothing

you can do it with cases too, but I prefer if and elseif due to my limited knowledge.

For more try:
http://msdn.microsoft.com/en-us/library/752y8abs.aspx
Latest Thanks - View all

1MShark(2014-11-12 06:39 PM) 
Reply
2014-11-12, 02:36 PM,
#4
Just add a textbox and a button on your form. After that ad this code under the button:
Code:
TextBox1.Text = Int(Rnd() * 4)
Select Case TextBox1.Text
Case 0
TextBox1.Text = "your first text"
Case 1
TextBox1.Text = "your 2 text"
Case 2
TextBox1.Text = "your 3 text"
Case 3
TextBox1.Text = "your 4 text"
Case 4
TextBox1.Text = "your 5 text"
Case 5
TextBox1.Text = "your 6 text"
End Select
Latest Thanks - View all

1MShark(2014-11-12 06:39 PM) CPA Puppy(2014-11-12 02:39 PM) 

Save water, shower with your girlfriend.
Reply
2014-11-12, 02:37 PM,
#5
(2014-11-12, 02:36 PM)Wakanda Wrote: Just add a textbox and a button on your form. After that ad this code under the button:
Code:
TextBox1.Text = Int(Rnd() * 4)
Select Case TextBox1.Text
Case 0
TextBox1.Text = "your first text"
Case 1
TextBox1.Text = "your 2 text"
Case 2
TextBox1.Text = "your 3 text"
Case 3
TextBox1.Text = "your 4 text"
Case 4
TextBox1.Text = "your 5 text"
Case 5
TextBox1.Text = "your 6 text"
End Select
A very good alternative. Thank you.
I am not the @OP, but I am still learning and trying to make a difference between (else,elseif) and case.
Latest Thanks - View all

1MShark(2014-11-12 06:39 PM) 
Reply
2014-11-12, 10:18 PM,
#6
Please remember ! "4" must correspond to the number of cases, in your case "4" most be replace with "6". else the program read just 4 cases


(2014-11-12, 02:37 PM)CPA Puppy Wrote:
(2014-11-12, 02:36 PM)Wakanda Wrote: Just add a textbox and a button on your form. After that ad this code under the button:
Code:
TextBox1.Text = Int(Rnd() * [b][color=#32CD32]4[/color][/b])
Select Case TextBox1.Text
Case 0
TextBox1.Text = "your first text"
Case 1
TextBox1.Text = "your 2 text"
Case 2
TextBox1.Text = "your 3 text"
Case 3
TextBox1.Text = "your 4 text"
Case 4
TextBox1.Text = "your 5 text"
Case 5
TextBox1.Text = "your 6 text"
End Select
A very good alternative. Thank you.
I am not the @OP, but I am still learning and trying to make a difference between (else,elseif) and case.
Reply
2014-11-13, 12:26 AM,
#7
(2014-11-12, 10:18 PM)BlueMan224 Wrote: Please remember ! "4" must correspond to the number of cases, in your case "4" most be replace with "6". else the program read just 4 cases


(2014-11-12, 02:37 PM)CPA Puppy Wrote:
(2014-11-12, 02:36 PM)Wakanda Wrote: Just add a textbox and a button on your form. After that ad this code under the button:
Code:
TextBox1.Text = Int(Rnd() * [b][color=#32CD32]4[/color][/b])
Select Case TextBox1.Text
Case 0
TextBox1.Text = "your first text"
Case 1
TextBox1.Text = "your 2 text"
Case 2
TextBox1.Text = "your 3 text"
Case 3
TextBox1.Text = "your 4 text"
Case 4
TextBox1.Text = "your 5 text"
Case 5
TextBox1.Text = "your 6 text"
End Select
A very good alternative. Thank you.
I am not the @OP, but I am still learning and trying to make a difference between (else,elseif) and case.
Thanks for the reminder. Rnd() means a random number from 1 to what you have after Rnd().
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  ▉ ▊AWESOME CONTENT WRITER NEEDED ▉ ▊ - Reviewer, Guider, Idolistic Figure, News Mania WealthyHustler 2 262 2017-08-08, 08:08 PM
Last Post: WealthyHustler
  Landing page movie Needed Krymi15 0 243 2017-08-04, 03:03 PM
Last Post: Krymi15
  Aeonsofts VB.NET Theme Manager v2.1 lanzye 29 9,744 2017-06-20, 06:55 PM
Last Post: storix
  [HELP NEEDED] Embedding P*rn videos to my adult WordPress Site nudes 15 1,786 2017-06-16, 02:09 PM
Last Post: tropicallad
  Help needed - Download link freakkz 3 529 2017-01-29, 10:23 PM
Last Post: CharlieHarper




About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top