Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.visual.basic    |    MS Visual Basic discussions, NOT dot-net    |    10,840 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 9,624 of 10,840    |
|    Rick Rothstein to All    |
|    Re: VB.NET backcolor syntax    |
|    21 Jul 05 14:46:54    |
      From: rickNOSPAMnews@NOSPAMcomcast.net              > Can anyone tell me the correct syntax when using a variable to control       > the color property?       >       > This works ok:       > If ABC2flash Then Label61.BackColor = Color.Yellow       >       > This doesn't, showing syntax error in source code:       > Dim ABC1col As String = "Color.Yellow"       > If ABC2flash Then Label61.BackColor = ABC1col              I don't use VB.NET myself (see the note at the end of this posting), but       I think I can guess at your problem. The BackColor property is a number       (in VB6 it would be a Long, but I'm not sure of the data type in VB.NET,       you'll have to look that up in your help files). You have defined       ABC1col as a String variable and are trying to assign a String variable       to a property requiring a numerical data type... hence, your error. Try       this (substituting the correct data type where I used |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca