|
-
Feb 15th, 2001, 04:04 AM
#1
Thread Starter
Addicted Member
does anyone know how i change the colour of a font in runtime,
what i am trying to do is on a form for a customer to fill out, if the customer misses out a question or answers it incorrectly i want the label for that question to turn say red.
i tried the help library
and it says
object.BackColor [= color]
but i tried replacing color with red
and even tried [=2550000] but i get an invalid property error what is wrong
-
Feb 15th, 2001, 07:14 AM
#2
Try:
Code:
object.BackColor = vbRed
-
Feb 15th, 2001, 12:41 PM
#3
Fanatic Member
If you want to change the font color I believe you should the Forecolor property not the backcolor property.
Code:
object.ForeColor = RGB(255,0,0)
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Feb 16th, 2001, 04:46 AM
#4
since vb colors are backwards, red would be &Hff, or 255, not 2550000 (which was also wrong, by the way)
-
Feb 16th, 2001, 10:23 AM
#5
-
Feb 16th, 2001, 04:44 PM
#6
Addicted Member
Blind
mebe im just blind, but i see no command1.Forecolor
:P
and the backcolor dosent change the font color
mebe you could bitblt it onto the control.. but that would just be lame, their must be some way to do this, ither thru the api or vb...
-
Feb 16th, 2001, 04:49 PM
#7
Fanatic Member
The forecolor of a command button is based on windows color settings.
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Feb 17th, 2001, 12:53 AM
#8
yeah. I forgot. Sorry :[
over the years, controls blur together in your mind...
i tried the settextcolor api call, and it doesn't seem to work on command buttons. All i can suggest is: Make a small bitmap in "Paintbrush" and use it as the button picture. you can use the same pic for up and down. The bitmap will be of the command button text in the color of your choice. There are other benefits of this method as well.
System font settings dont affect the button display, potentially making the button unreadable. Trust me, its real easy. A large point font will word-wrap to the next line, which isn't visible, etc. Trust me, it's not worth the headache of trying to resize the buttons.
-
Feb 17th, 2001, 12:15 PM
#9
Use the CommandButton shipped with Sheridan 3D Controls. It's exactly the same as the standard button, expect it's a little more flexible (which includes changing the forecolor of the button).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|