No BackColor Propoerty on a Command Button

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Please could someone suggest a way of doing the equivalent of setting a
BackColor property on a command button on a form? I can set the Picture
property but it has to be sized to the button and that is fiddly. Basically
I just want to set a command button to have a particular coloured
background.

Any help appreciated.

Thanks,

Michael.
 
Thakns for this,

It's quite complicated to include in my existing database ... can I just set
up a reference to the example database and invoke the function simply?

All the best,

Michael.
 
Michael what is so complicated about including one standard Code module
in your own MDB? Just import it into your app.
To call the function that will change the BackColor of the CommandButton
is simple:

Dim lngBool As Boolean

' Pass the Selected Color to the function
lngBool = fCmdButTextPic(Me.CmdBackColor, lngBackColor)

To allow the user to select their desired color via the standard WIndows
Color Dialog is also easy to do:


' Call the Color Picker Dialog
lngBackColor = aDialogColor()
' If error set ForeColor to Black

Just look at the code behind the sample Form. We are talking about a
total of 4 lines of code behind your Form to allow your users to call
the Color DIalog WIndow and set their selection as the BackColor of the
CommandButton. Two of those 4 lines of code are Var declarations!


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Michael,

Access has nothing built-in to allow for changes in the command button
backcolor. There are some third-party tools that may help:

A shareware version of Button Painter for MS Access is available at
this web site: http://www.peterssoftware.com/bp.htm

Some simple colored button examples that can be copied into your
application are available at: http://www.peterssoftware.com/clrbtn.htm

Stephen Lebans has an example database that shows how to set a command
button back color and more: http://www.lebans.com/cmdbutton.htm

There are nice "Color Command Buttons" downloads at this site:
http://www.candace-tripp.com/access_downloads.htm

Hope this helps,
 
Back
Top