home bbs files messages ]

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,625 of 10,840   
   Keith R. Weimer to Dave@dimos.biz   
   Re: VB.NET backcolor syntax   
   21 Jul 05 15:35:36   
   
   From: KillerQ13@hotmail.com   
      
    wrote in message   
   news:a_qdnTsJxYF5e0LfRVnytg@giganews.com...   
   > Hi,   
   >   
   > 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   
   >   
   > Thanks   
      
   Use the Color.FromName function.  You'll have to remove the "Color." part of   
   the string but it's a start.   
      
   Example:   
   Label.BackColor = Color.FromName("Yellow")   
      
   Keith R. Weimer   
   Way Too Happy Software   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca