470,596 Members | 1,212 Online 11
im trying to do this assignment for skool and i have completely forgot how to do this. i have 2 pic boxes and 1 button wen i click that button i want it to get a random number diff one for both but it can sumtimes be the same but the number will be from 1 - 6 and if it = 1 then i have a pic of a dice face that has a number 1 on it and if it = 2 then a dice pic with 2 on it and so on but i dont kno how to get it to do any of that i was using like select case but im stuck plz help
Jul 31 '07 #1
3 1591 rd301
7 im trying to do this assignment for skool and i have completely forgot how to do this. i have 2 pic boxes and 1 button wen i click that button i want it to get a random number diff one for both but it can sumtimes be the same but the number will be from 1 - 6 and if it = 1 then i have a pic of a dice face that has a number 1 on it and if it = 2 then a dice pic with 2 on it and so on but i dont kno how to get it to do any of that i was using like select case but im stuck plz help
hello

kindly tell which language u r using for pragramming.

RD
Jul 31 '07 #2
vagaisuresh
17 im trying to do this assignment for skool and i have completely forgot how to do this. i have 2 pic boxes and 1 button wen i click that button i want it to get a random number diff one for both but it can sumtimes be the same but the number will be from 1 - 6 and if it = 1 then i have a pic of a dice face that has a number 1 on it and if it = 2 then a dice pic with 2 on it and so on but i dont kno how to get it to do any of that i was using like select case but im stuck plz help
Example from my project. I get this code from online friends.

[HTML]
Private Sub HidePicture()

Dim MyCondition As Integer

If cmbShape = "Angle" Then
MyCondition = 1
ElseIf cmbShape = "Circle" Then
MyCondition = 2
ElseIf cmbShape = "Circular Tube" Then
MyCondition = 3
ElseIf cmbShape = "Hexagon (A/F)" Then
MyCondition = 4
ElseIf cmbShape = "Hexagon (A/C)" Then
MyCondition = 5
ElseIf cmbShape = "Hollow Rectangle" Then
MyCondition = 6
ElseIf cmbShape = "I-Beam" Then
MyCondition = 7
ElseIf cmbShape = "Octagon (A/F)" Then
MyCondition = 8
ElseIf cmbShape = "Octagon (A/C)" Then
MyCondition = 9
ElseIf cmbShape = "Rectangle" Then
MyCondition = 10
ElseIf cmbShape = "Square" Then
MyCondition = 11
ElseIf cmbShape = "Tee Section" Then
MyCondition = 12
ElseIf cmbShape = "U-Channel" Then
MyCondition = 13
Else
End If

Show_PBox MyCondition

End Sub

Sub Show_PBox(Index As Integer)

' Hide all pictureboxes
Dim i As Integer
For i = 0 To 12
picShape(i).Visible = False
Next i

' Show the requested picturebox
picShape(Index - 1).Visible = True

End Sub
[/HTML]
Jul 31 '07 #3
Zaccy
11 i am using visual basic
and i need the coide to load a file from like a folder in my computer code in the old visual basic 6.0 it is like ::

Randomize
Select Case Int(Rnd * 6)+1

Case 1

and so on
but i need the code for the new version as this dont work
thanx heaps
Aug 1 '07 #4