Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Command Button font clour (VB6)

    This is probably easy, but can ayone tell me where to change the font colour of a command button? I have looked in the control's properties but can't find it. Probably staring me in the face. Thanks.

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Command Button font clour (VB6)

    You should find a ForeColor property, which sets the text color of a control. Can be done in code

    <big>object.ForeColor = color</big>


    Andrew C

  4. #3
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Command Button font clour (VB6)

    Andrew - is there a reason why my version of VB6 does not have a property for ForeColor for command buttons? Thanks heaps.

    Bill

  5. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Command Button font clour (VB6)

    ForeColor doesn't show up in the properties list but it is a valid property for VB objects. Unfortunately, it doesn't seem to work in VB, regardless of the help files.
    Charlotte

  6. #5
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Command Button font clour (VB6)

    Charlotte - That's a shame:-) Oh well I think I will just have to add a little life to my command buttons with some graphics. Thanks as always.

    Bill

  7. #6
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Command Button font clour (VB6)

    <P ID="edit" class=small>(Edited by SammyB on 06-Jul-03 06:08. Changed URL to include frame)</P>I almost don't want to tell you how to do this because I hate applications that have "a little life" added to them. Remember, not all of us are as young as you: our vision is impaired and we expect button to look like buttons. Having said that, believe it or not you can do exactly what you want with a checkbox! Add a normal VB checkbox (must be VB not VBA) and set the Style property to 1-Graphical and voil
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  8. #7
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Command Button font clour (VB6)

    Sam - thanks heaps for that. By the way, I am probably older than you! :-) The reason why I need need to add some graphics to my app (command buttons only) is because the application will have to be used by people where English is not their first language (Chinese, Indian mainly) and I was going to add graphic to icons to make it clearer for them to understand what each button was for.
    Any advice for me in this area?
    Thanks again.

    Bill

  9. #8
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Command Button font clour (VB6)

    Just a generic 2

  10. #9
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Command Button font clour (VB6)

    Good point. Thanks.

  11. #10
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Command Button font clour (VB6)

    > I am probably older than you
    Didn't think that was possible. When I started programming, we had to read the compiler and linker in from card decks. <img src=/S/gramps.gif border=0 alt=gramps width=20 height=20>

    > Re: multi-language support
    You can provide multi-language support without too much extra work by using a .res file. Make a sample application using the VB Application Wizard. Take the defaults for each step, except just build an SDI app (less code to wade thru) and, most important, in the 4th step, check Yes to build a Resource file. Looking at your form, you will notice that the menu is just numbers. Then, looking at the LoadResStrings in Module1, you can see how these numbers are converted into text using VB's LoadResString function. Notice also that you could get the FontName from one of the res strings to get a Chinese or Indian font. Finally, look at the resource file. If you closed it, reopen with the Tools | Resource editor and double click on the String table. Unfortunately, MS has only provided one language, but if you click on the second button ( Insert new string table), you can see how it works with two languages. Assuming English is your default language, this column is labeled English.... Add a different name for the File menu, say FFF. Now, when you run the project, you will see FFF instead of File. If you do a Google search for LoadResString, you will see other examples such as this one from Experts-Exchange. HTH --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

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