ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dim Userform Control (https://www.excelbanter.com/excel-programming/344017-dim-userform-control.html)

donbowyer

Dim Userform Control
 
Is there an easy bit of code for dimming a UserForm Control when not in use?
--
donwb

Chip Pearson

Dim Userform Control
 
I'm not sure what you're after, perhaps more detail would be
helpful. But you can declare a variable of a control's type with
code like

Dim MyComboBox As MSForms.ComboBox
Set MyComboBox = UserForm1.ComboBox1


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"donbowyer" wrote in
message
...
Is there an easy bit of code for dimming a UserForm Control
when not in use?
--
donwb




Jim Thomlinson[_4_]

Dim Userform Control
 
You are probably looking for the enabled property.

CommandButton1.Enabled = False
--
HTH...

Jim Thomlinson


"donbowyer" wrote:

Is there an easy bit of code for dimming a UserForm Control when not in use?
--
donwb


Chip Pearson

Dim Userform Control
 
Your answer is probably what the user wanted. I took "dimming" to
mean using a Dim statement, not the more obvious "making
something dim". My mistake.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Jim Thomlinson" wrote in message
...
You are probably looking for the enabled property.

CommandButton1.Enabled = False
--
HTH...

Jim Thomlinson


"donbowyer" wrote:

Is there an easy bit of code for dimming a UserForm Control
when not in use?
--
donwb




RB Smissaert

Dim Userform Control
 
There is a problem with UserForm SpinButtons in that they can be disabled
like that but they won't look disabled.

Will have to do as well:
ForeColor = vbButtonShadow

RBS


"Jim Thomlinson" wrote in message
...
You are probably looking for the enabled property.

CommandButton1.Enabled = False
--
HTH...

Jim Thomlinson


"donbowyer" wrote:

Is there an easy bit of code for dimming a UserForm Control when not in
use?
--
donwb



donbowyer

Dim Userform Control
 
I'm not now sure I can do what I thought I could do ie dimming (less bright)
a TextBox. But one of your suggestions - set it to active=false will do fine.
Thanks everyone
--
donwb


"donbowyer" wrote:

Is there an easy bit of code for dimming a UserForm Control when not in use?
--
donwb



All times are GMT +1. The time now is 08:51 PM.

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