We have learned how to create a digital dice using Visual Basic 2010 in Visual Basic 2010 Tutorial Lesson 27. Now we wish to create a graphical dice which resembles the real dice instead.
Writing the code to create a graphical dice in Visual Basic 2010 is slightly different from the code in VB6. In VB6, we used the shape control to draw the dots. However, in Visual Basic 2010, there is no built-in shape tool so we use images instead. Therefore, the first step in creating a graphical dice in Visual Basic 2010 is to create six images, each denote one of the faces of the dice. Next, you write a code that load the images randomly, it is that simple.
View the code here.