Selecting the Dice

To begin, let's write code that allows a user to select a dice to hold when he or she clicks on its image. This means you have to change the Value property of the Check Box controls from the Click() event procedure of the Image controls. The user is allowed to toggle the Check Box on and off, so you should use the Not operator to change the Boolean value of the Check Box's Value property. The user can accomplish the same thing by clicking on the Check Box directly; however, you don't need to write any code for this as it's automatically handled by the Check Box.

Option Explicit

Private Sub imgDice1_Click()

ckBox1.Value = Not ckBox1.Value End Sub

Private Sub imgDice2_Click()

ckBox2.Value = Not ckBox2.Value End Sub

Private Sub imgDice3_Click()

ckBox3.Value = Not ckBox3.Value End Sub

Private Sub imgDice4_Click()

ckBox4.Value = Not ckBox4.Value End Sub

Private Sub imgDice5_Click()

ckBox5.Value = Not ckBox5.Value End Sub

Biorhythm Awareness

Biorhythm Awareness

Who else wants to take advantage of biorhythm awareness to avoid premature death, escape life threatening diseases, eliminate most of your life altering mistakes and banish catastrophic events from your life.

Get My Free Ebook

Post a comment