Visual Basic Explorer
Visual Basic Explorer
 Navigation
 Home


 Coding
 Source Code

 FAQ Center

 VB Tips

 Downloads

 ToolBox

 Tutorials

 VB Games

 VB News

 VB Award

 VB Forums



 Affiliates
 Planet Source Code

 Rent a Coder

 DirectX4VB


 Misc
 Search

 Feedback

 Advertise

 About


Need to hire
a VB coder?

Please support our sponsor:

 Home 
 Site Map 
 Forums 
 News 
 Feedback 

 

'-------------------------------------
'Author: Finney Family
'Email: jfinney@ihug.com.au
'Added: 13-June-2000
'-------------------------------------
'Program: EASYDICE.ZIP
'-------------------------------------
'Description: Shows how to create a
'pair of dice(not the numbers but the
'picture kind(with dots))
'-------------------------------------

 
Private Sub Command1_Click()
For i = 0 To 13
Shape1(i).FillStyle = 1
Next i

 
Dim MyValue
Randomize
MyValue = Int((6 * Rnd) + 1)
MyValue1 = Int((6 * Rnd) + 1)
If MyValue = 1 Then
Shape1(3).FillStyle = 0
ElseIf MyValue = 2 Then
Shape1(0).FillStyle = 0
Shape1(6).FillStyle = 0
ElseIf MyValue = 3 Then
Shape1(0).FillStyle = 0
Shape1(3).FillStyle = 0
Shape1(6).FillStyle = 0
ElseIf MyValue = 4 Then
Shape1(0).FillStyle = 0
Shape1(1).FillStyle = 0
Shape1(5).FillStyle = 0
Shape1(6).FillStyle = 0
ElseIf MyValue = 5 Then
Shape1(0).FillStyle = 0
Shape1(1).FillStyle = 0
Shape1(3).FillStyle = 0
Shape1(5).FillStyle = 0
Shape1(6).FillStyle = 0
Else
Shape1(0).FillStyle = 0
Shape1(1).FillStyle = 0
Shape1(2).FillStyle = 0
Shape1(4).FillStyle = 0
Shape1(5).FillStyle = 0
Shape1(6).FillStyle = 0
End If
If MyValue1 = 1 Then
Shape1(10).FillStyle = 0
ElseIf MyValue1 = 2 Then
Shape1(7).FillStyle = 0
Shape1(13).FillStyle = 0
ElseIf MyValue1 = 3 Then
Shape1(7).FillStyle = 0
Shape1(10).FillStyle = 0
Shape1(13).FillStyle = 0
ElseIf MyValue1 = 4 Then
Shape1(7).FillStyle = 0
Shape1(8).FillStyle = 0
Shape1(12).FillStyle = 0
Shape1(13).FillStyle = 0
ElseIf MyValue1 = 5 Then
Shape1(7).FillStyle = 0
Shape1(8).FillStyle = 0
Shape1(10).FillStyle = 0
Shape1(12).FillStyle = 0
Shape1(13).FillStyle = 0
Else
Shape1(7).FillStyle = 0
Shape1(8).FillStyle = 0
Shape1(9).FillStyle = 0
Shape1(11).FillStyle = 0
Shape1(12).FillStyle = 0
Shape1(13).FillStyle = 0
End If

End Sub

 
'-------------------------------------
'Burt Abreu
'http://www.VBExplorer.com
'-------------------------------------


Downloads

In IE right-click and select 'Save Target As...' or in Netscape right-click and select 'Save Link As...'

 

View Plain Text View Plain Text
Download Demo Project Download Demo Project
View Code Online Not Available





Home | About | What's New | Source Code | FAQ | Tips & Tricks | Downloads | ToolBox | Tutorials | Game Programming | VB Award | Search | VB Forums | Feedback | VBNews | Copyright & Disclaimer | Advertise | Privacy Policy |

Quick searches: Site Search | Advanced Site Search 

Copyright 2002 by Exhedra Solutions, Inc.
By using this site you agree to its terms and conditions
VB Explorer and VBExplorer.com are trademarks of Exhedra Solutions, Inc.