Help

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Help

Post by Patrickssj6 »

How do i make it that when i press on a button in one Textbox is will give me a random number from 1-10.This is in VB6
...left for good
modder4321





Posts: 118
Joined: Wed Mar 30, 2005 5:35 pm

Post by modder4321 »

Code: Select all

private sub command1_click()
text1.text = int(rnd * 10)
end sub
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

Yes i found it already on google.Tnx anyway.BUt i have another problem:
I want to make that if TextBox1 equals TextBox2 there will be a MessageBox.BUt som,ehow it doesn't work.
This is what i did:

Code: Select all

If TextBox1.Equals(TextBox2 Then
MessageBox.Show("You have done it")
Else
MessageBox.SHow("Try again")
...left for good
modder4321





Posts: 118
Joined: Wed Mar 30, 2005 5:35 pm

Post by modder4321 »

Patrickssj6 wrote:Yes i found it already on google.Tnx anyway.BUt i have another problem:
I want to make that if TextBox1 equals TextBox2 there will be a MessageBox.BUt som,ehow it doesn't work.
This is what i did:

Code: Select all

If TextBox1.Equals(TextBox2 Then
MessageBox.Show("You have done it")
Else
MessageBox.SHow("Try again")
wat are u coding in?
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

VB6
...left for good
modder4321





Posts: 118
Joined: Wed Mar 30, 2005 5:35 pm

Post by modder4321 »

where the fuck u get that code it would be

Code: Select all

private sub command2_click()
if text1.text = text2.text then
msgbox("yea its equal")
else
msgbox("not equal =<")
endif
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

well that code doesn't work for me.I have the express edition if this helps.But i try to change it to my version gimme a sec
...left for good
modder4321





Posts: 118
Joined: Wed Mar 30, 2005 5:35 pm

Post by modder4321 »

Patrickssj6 wrote:well that code doesn't work for me.I have the express edition if this helps.But i try to change it to my version gimme a sec
make 2 text boxes and 2 command buttons in code section have this

Code: Select all

private sub command1_click()
text1.text and text2.text = int(rnd * 10)
end sub

private sub command2_click() 
if text1.text = text2.text then 
msgbox("yea its equal") 
else 
msgbox("not equal =<") 
endif
end sub
Post Reply