CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Nov 2005
    Posts
    95

    setting backcolor using a string

    Hmmm... I have a string , say

    strUncleFred = "vbRed"
    or
    strUncleFred = "vbGreen"

    then I want

    textGoat.BackColor = strUncleFred

    But I get a type mismatch error. I see that .backcolor expects a long value, so I tried using
    Clng(strUncleFred) ....but that got me nowhere
    I really want to use only the simple Vb colors specified when the use types in a string.

    I can see that vbRed is a constant and "vbRed" is something else--a string, but can you convert one to the other so easy way?
    Last edited by vbcandies; December 14th, 2009 at 04:03 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured