Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42202

For Loop

$
0
0
Hello all,

i have a random number generator to generate a random number from 1 to 26 (Dim intrandom As Integer = Int(Rnd() * 26) + 1) and an array of pic boxes (Dim picarray(25) As PictureBox). i was wondering how to make the pic boxes visible (theyre visible.false at launch) according to the random number. for example pretty much a shortened version of:

if intrandom=1 then
picbox1.visible=true
elseif intrandom=2 then
picbox2.visible=true

etc., etc.

im a little confused on for loops. thanks!

Viewing all articles
Browse latest Browse all 42202

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>