ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   toggle button text color (https://www.excelbanter.com/excel-discussion-misc-queries/39218-toggle-button-text-color.html)

John Davies

toggle button text color
 
is it possible to change the text color of a toggle button text depending
whether the toggle button value is true or false

Dave Peterson

This worked ok for me:

Option Explicit
Private Sub ToggleButton1_Click()
With Me.ToggleButton1
If .Value = True Then
.ForeColor = &H8000000D
Else
.ForeColor = &HFF&
End If
End With
End Sub


John Davies wrote:

is it possible to change the text color of a toggle button text depending
whether the toggle button value is true or false


--

Dave Peterson

keithl816

toggle button text color
 

How can this be changed so that when the button is out it is black and
when it is pushed in it is red?

Larry


--
keithl816
------------------------------------------------------------------------
keithl816's Profile: http://www.excelforum.com/member.php...o&userid=21287
View this thread: http://www.excelforum.com/showthread...hreadid=393822


Peo Sjoblom

toggle button text color
 
Don't think that's possible, you can change the text colour in the button's
properties but I don't know of a way to have 2 different colours

--

Regards,

Peo Sjoblom


"keithl816" wrote
in message ...

How can this be changed so that when the button is out it is black and
when it is pushed in it is red?

Larry


--
keithl816
------------------------------------------------------------------------
keithl816's Profile:

http://www.excelforum.com/member.php...o&userid=21287
View this thread: http://www.excelforum.com/showthread...hreadid=393822




keithl816

toggle button text color
 

Daves code works but the font in the button comes up green, what needs
to be changed so that it is black instead of green? I've changed the
true to false so that the red shows up when ther button is pushed in,
when it's out it is green.

CODE]
If .Value = True Then
.ForeColor = &H8000000D
Else
.ForeColor = &HFF&
End If

--------------------


Thanks

Larry


--
keithl816
------------------------------------------------------------------------
keithl816's Profile: http://www.excelforum.com/member.php...o&userid=21287
View this thread: http://www.excelforum.com/showthread...hreadid=393822


keithl816

toggle button text color
 

I figured it out.

Thanks


Code:
--------------------

With Me.ToggleButton1
If .Value = False Then
.ForeColor = &H0
Else
.ForeColor = &HFF&
End If
End With

--------------------



Larry


--
keithl816
------------------------------------------------------------------------
keithl816's Profile: http://www.excelforum.com/member.php...o&userid=21287
View this thread: http://www.excelforum.com/showthread...hreadid=393822



All times are GMT +1. The time now is 02:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com