PC Review


Reply
Thread Tools Rate Thread

Checkbox Background Color

 
 
AJ Master
Guest
Posts: n/a
 
      9th Jan 2008
I have placed several checkboxes on my spreadsheet and under
properties for the checkbox I have selected the backstyle =
fmBackStyleTransparent. My problem seems to be that whenever I click
on the checkbox the background color changes from the color of the
cell to white. On the properties window the BackColor is set to white
so I'm guessing this is the problem. Does anyone know how to change
the back color to transparent as well? I cannot select the cell color
because it does not appear as a choice on the palette when I try to
change it to that?

Any help would be appreciated.

AJ
 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      9th Jan 2008
Unfortunately, although you can apply Transparent it does not persit when
the control is clicked, it will then show whatever colour is set for its
backcolor property. I don't know if this has been fixed in XL2007

Regards,
Peter T

"AJ Master" <(E-Mail Removed)> wrote in message
news:03a64171-58ab-489e-bf9f-(E-Mail Removed)...
>I have placed several checkboxes on my spreadsheet and under
> properties for the checkbox I have selected the backstyle =
> fmBackStyleTransparent. My problem seems to be that whenever I click
> on the checkbox the background color changes from the color of the
> cell to white. On the properties window the BackColor is set to white
> so I'm guessing this is the problem. Does anyone know how to change
> the back color to transparent as well? I cannot select the cell color
> because it does not appear as a choice on the palette when I try to
> change it to that?
>
> Any help would be appreciated.
>
> AJ


 
Reply With Quote
 
AJ Master
Guest
Posts: n/a
 
      9th Jan 2008
On Jan 9, 2:36 pm, "Peter T" <peter_t@discussions> wrote:
> Unfortunately, although you can apply Transparent it does not persit when
> the control is clicked, it will then show whatever colour is set for its
> backcolor property. I don't know if this has been fixed in XL2007
>
> Regards,
> Peter T
>
> "AJ Master" <amitmas...@gmail.com> wrote in message
>
> news:03a64171-58ab-489e-bf9f-(E-Mail Removed)...
>
> >I have placed several checkboxes on my spreadsheet and under
> > properties for the checkbox I have selected the backstyle =
> > fmBackStyleTransparent. My problem seems to be that whenever I click
> > on the checkbox the background color changes from the color of the
> > cell to white. On the properties window the BackColor is set to white
> > so I'm guessing this is the problem. Does anyone know how to change
> > the back color to transparent as well? I cannot select the cell color
> > because it does not appear as a choice on the palette when I try to
> > change it to that?

>
> > Any help would be appreciated.

>
> > AJ


Peter,

Is there anyone to code an event change that would update the
backcolor? Is there a way to add the custom color I'm using to the
color palette excel shows me?

Thanks again...AJ
 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      9th Jan 2008

"AJ Master" <(E-Mail Removed)> wrote in message
news:d5560465-e529-45f2-b027-(E-Mail Removed)...
> On Jan 9, 2:36 pm, "Peter T" <peter_t@discussions> wrote:
>> Unfortunately, although you can apply Transparent it does not persit when
>> the control is clicked, it will then show whatever colour is set for its
>> backcolor property. I don't know if this has been fixed in XL2007
>>
>> Regards,
>> Peter T
>>

<snip
>
> Peter,
>
> Is there anyone to code an event change that would update the
> backcolor? Is there a way to add the custom color I'm using to the
> color palette excel shows me?
>
> Thanks again...AJ


Dim ole As OLEObject

Set ole = ActiveSheet.OLEObjects("Checkbox1")
ole.Object.BackColor = RGB(150, 200, 250)

' customize a palette color
ActiveWorkbook.Colors(7) = RGB(250, 200, 150)
' 7 is under red in a default palette
' apply a palette colour
ole.Object.BackColor = ActiveWorkbook.Colors(7)

You mention 'event' so maybe something like this (code in the sheet module
containng the checkbox)

Private Sub CheckBox1_Click()
With CheckBox1
If .Value Then
..BackColor = RGB(255, 255, 255)
Else
..BackColor = RGB(150, 230, 150)
End If
End With
End Sub

Regards,
Peter T

 
Reply With Quote
 
AJ Master
Guest
Posts: n/a
 
      10th Jan 2008
On Jan 9, 3:40 pm, "Peter T" <peter_t@discussions> wrote:
> "AJ Master" <amitmas...@gmail.com> wrote in message
>
> news:d5560465-e529-45f2-b027-(E-Mail Removed)...
>
>
>
> > On Jan 9, 2:36 pm, "Peter T" <peter_t@discussions> wrote:
> >> Unfortunately, although you can apply Transparent it does not persit when
> >> the control is clicked, it will then show whatever colour is set for its
> >> backcolor property. I don't know if this has been fixed in XL2007

>
> >> Regards,
> >> Peter T

>
> <snip
>
> > Peter,

>
> > Is there anyone to code an event change that would update the
> > backcolor? Is there a way to add the custom color I'm using to the
> > color palette excel shows me?

>
> > Thanks again...AJ

>
> Dim ole As OLEObject
>
> Set ole = ActiveSheet.OLEObjects("Checkbox1")
> ole.Object.BackColor = RGB(150, 200, 250)
>
> ' customize a palette color
> ActiveWorkbook.Colors(7) = RGB(250, 200, 150)
> ' 7 is under red in a default palette
> ' apply a palette colour
> ole.Object.BackColor = ActiveWorkbook.Colors(7)
>
> You mention 'event' so maybe something like this (code in the sheet module
> containng the checkbox)
>
> Private Sub CheckBox1_Click()
> With CheckBox1
> If .Value Then
> .BackColor = RGB(255, 255, 255)
> Else
> .BackColor = RGB(150, 230, 150)
> End If
> End With
> End Sub
>
> Regards,
> Peter T


Peter,

Thanks again. I set the property on all checkboxes when the workbook
opens.

AJ
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook form - Checkbox - Change background color Simon Minder Microsoft Outlook Discussion 5 4th Jun 2010 03:28 PM
Checkbox to change background color, font color and remove/ add bo Sara Microsoft Excel Misc 1 11th Nov 2008 08:17 PM
Color code Yes/No checkbox and text dependent on checkbox =?Utf-8?B?VG90YWxseUNvbmZ1c2Vk?= Microsoft Access Forms 2 16th Feb 2006 07:38 PM
ListIView checkbox background color ... H.B. Microsoft VC .NET 0 3rd Jun 2005 03:15 PM
Flatstyle changes background color of the checkbox and radio button. =?ISO-8859-1?Q?Juan_Dar=EDo_Tempesta?= Microsoft Dot NET Framework Forms 0 12th Sep 2003 10:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:06 PM.