Some Command Buttons Not Using QuickStyle

JamesJoey

Registered User.
Local time
Today, 09:33
Joined
Dec 6, 2010
Messages
642
Code:
Public Function BtnProperties(frm As Form)
For Each ctl In frm.Controls
If ctl.ControlType = acCommandButton Then

            ctl.QuickStyle = 37
End If

I'm calling tis code in the onload of all my forms.
Problem is, mnost of the form's comand buttons are honoring the QuickStyle. But, on one nform none of the buttons are are using the quickstyle and on another form one button is and the other 2 isn't.

The only diffeence I can see is the top, bottom, left and right padding values.
And matching them up doesn't work.

Any ideas what's happening here??
James
 
This may not be relevant but, in my experience, forms created before a style was applied do not automatically assign the style to new control buttons.

However do check that you have set Use Theme property = Yes for all buttons

Otherwise one solution is to create a new form from scratch, copy & paste only those controls where the style is applied & re-create the remaining controls.

NOTE:
I've never used the ctl.quickstyle property before though I can see how its useful.
How do you obtain the quick style number?
 
Last edited:
I've heard of that also, where themes aren't applied to existing forms.
But, why is the theme being applied to some but not all?? One would think no form's buttons would apply the theme.
If I copy and paste a button from a form where the cmd is using the tbeme, the button uses the theme.
these are all existing forms that I've been using for a long time.
 
I've heard of that also, where themes aren't applied to existing forms.
But, why is the theme being applied to some but not all?? One would think no form's buttons would apply the theme.
If I copy and paste a button from a form where the cmd is using the tbeme, the button uses the theme.
these are all existing forms that I've been using for a long time.

Who knows why. It's Microsoft!
Have you checked Use Theme is set to Yes for all controls.
If not, the buttons will have the pre 2007 appearance.
 
Yes, Use Theme is set to yes on all buttons.

Things like this are keeping from upgrading to 2016.
I just won't use the QuickStyle.
 
Just an addition.

I took out the line setting the QuickStyle.
Lo and behold one form's buttons retained the QuckeStyle.
I had to go in and change bunch of stuff to get the buttons back to normal.

Not really surprised.
 

Users who are viewing this thread

Back
Top Bottom