Adding a random number roll dice image in vb for aesthetics

Asked By 0 points N/A Posted on -
qa-featured

How do I add a random number roll dice image in vb to ensure that apart from the logic part, my application also has an appeal of aesthetic value?

 
SHARE
Best Answer by Opland Pamela
Answered By 0 points N/A #144854

Adding a random number roll dice image in vb for aesthetics

qa-featured

To add a picture in VB select the picture you want to add name it as dice and should know the Path of the file(By right clicking the image you will get the path) . Suppose its in the directory ‘D: Imagesdice.jpg’.
LoadPicture is the method used to add pictures, code for that method is:
Dice.Picture=LoadPicture(“D:Imagesdice.jpg”).

Best Answer
Best Answer
Answered By 0 points N/A #197884

Adding a random number roll dice image in vb for aesthetics

qa-featured

Hello Christina Turner,

 

To answer your question I will give you some tips:

– Create a function (eg. rolldice) then insert a randomizer from 1 to 6.

– See if it generates a number from 1 to 6. (Make sure to set the variable to int.)

– Get the images of the faces of a die, put them all in an imagebox (copy and paste the imagebox, when asked to create a control array, click 'Yes'). Set all visible value to "False".

– Set them according to their face value and put them on top of one another.

– When clicking a Command Button, set an initializer (Assign all visible values as "False") and make a select statement so that when a number shows up, it sets its value to "True".

– For aesthetic effect, place a timer so that whenever a Command Button is pressed, it will randomize a number for a set time then stop.

 

Hope this helps.

Related Questions