Click here to Skip to main content
15,917,005 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Random letters Pin
harveyhanson6-Feb-07 8:41
harveyhanson6-Feb-07 8:41 
GeneralRe: Random letters Pin
Christian Graus6-Feb-07 9:39
protectorChristian Graus6-Feb-07 9:39 
GeneralRe: Random letters Pin
Guffa6-Feb-07 10:33
Guffa6-Feb-07 10:33 
GeneralRe: Random letters [modified] Pin
TwoFaced6-Feb-07 12:17
TwoFaced6-Feb-07 12:17 
GeneralRe: Random letters Pin
harveyhanson18-Feb-07 11:40
harveyhanson18-Feb-07 11:40 
GeneralRe: Random letters Pin
TwoFaced18-Feb-07 11:47
TwoFaced18-Feb-07 11:47 
GeneralRe: Random letters Pin
harveyhanson18-Feb-07 12:01
harveyhanson18-Feb-07 12:01 
GeneralRe: Random letters Pin
TwoFaced18-Feb-07 19:28
TwoFaced18-Feb-07 19:28 
Actually it wasn't necessary to change the variable 'lbl' to lblLetter. What the function does is loops through every control on your form or whatever parent control you passed in. Every control weather it's a button, or textbox, or label inherits from the control class. TryCast attempts to convert the control to a label. If this succeeds then lbl will contain a reference to a label that's on your form. However, if the control is a button or some other control that isn't a label the cast will fail and nothing will be returned. So we need to check to make sure 'lbl' isn't nothing. The function accepts a pattern so you can limit which labels get random letters, otherwise all labels on the form would get a random letter which may not be desirable. So the second part of the if statement checks to see that the name of the label matches a given patter. In your case you've named your labels that get random letters as lblLetter1, lblLetter2 and so on. So you would pass in the pattern lblLetter*. Simply put with that pattern any label with a name that begins with lblLetter will get a random letter. Hope that clears that line up.
QuestionDisplay Pin
Misanthropia6-Feb-07 5:53
Misanthropia6-Feb-07 5:53 
AnswerRe: Display Pin
Christian Graus6-Feb-07 9:42
protectorChristian Graus6-Feb-07 9:42 
QuestionListView Pin
CodingYoshi6-Feb-07 4:40
CodingYoshi6-Feb-07 4:40 
AnswerRe: ListView Pin
TwoFaced6-Feb-07 7:20
TwoFaced6-Feb-07 7:20 
GeneralRe: ListView Pin
CodingYoshi6-Feb-07 14:36
CodingYoshi6-Feb-07 14:36 
GeneralRe: ListView Pin
TwoFaced6-Feb-07 16:34
TwoFaced6-Feb-07 16:34 
Questiondelay ? Pin
Narfix6-Feb-07 4:26
professionalNarfix6-Feb-07 4:26 
QuestionHow can i make an installable file...? Pin
fmlove6-Feb-07 4:10
fmlove6-Feb-07 4:10 
AnswerRe: How can i make an installable file...? Pin
Taylor Kobani6-Feb-07 5:21
Taylor Kobani6-Feb-07 5:21 
AnswerRe: How can i make an installable file...? Pin
FeRtoll6-Feb-07 6:21
FeRtoll6-Feb-07 6:21 
GeneralRe: How can i make an installable file...? Pin
fmlove6-Feb-07 22:46
fmlove6-Feb-07 22:46 
GeneralRe: How can i make an installable file...? Pin
FeRtoll7-Feb-07 2:53
FeRtoll7-Feb-07 2:53 
QuestionHow can i make an installable file...? Pin
fmlove6-Feb-07 4:10
fmlove6-Feb-07 4:10 
AnswerRe: How can i make an installable file...? Pin
Kschuler6-Feb-07 10:12
Kschuler6-Feb-07 10:12 
QuestionXML Pin
samerh6-Feb-07 3:57
samerh6-Feb-07 3:57 
AnswerRe: XML Pin
Christian Graus6-Feb-07 9:43
protectorChristian Graus6-Feb-07 9:43 
QuestionScreensaver to play first... Pin
Dave McCool6-Feb-07 3:50
Dave McCool6-Feb-07 3:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.