Unable to reset mangled ActiveX button font sizes through code or properties

drhansenjr

New Member
Joined
Oct 31, 2014
Messages
19
I have a series of ActiveX command buttons on a worksheet that cause certain columns to be selectively shown or hidden. When switching to a projector display, several of these buttons change in dimensions and font size to something smaller than the desired 8px. I have written a procedure attached to another button that should reset the buttons to their proper dimensions, positions and font sizes, but it is not working on the font sizes. Manually setting the font sizes through the button properties window has no effect either -- the font sizes still remain smaller than 8px. I am attaching the code for the "cleanup" button that should reset the font sizes and button positions/dimensions.
Any idea what's going on?
Code:
Private Sub btnCleanup_Click()
    Const stdFontSize As Integer = 8
    Const stdButtonHeight As Integer = 20
    
    btnCleanup.Font.Size = stdFontSize
    btnCleanup.Height = stdButtonHeight
    btnCleanup.Left = 403.5
    btnCleanup.Width = 43.5
    btnCleanup.Top = 34.5
    btnCollapse.Font.Size = stdFontSize
    btnCollapse.Height = stdButtonHeight
    btnCollapse.Left = 612.65
    btnCollapse.Width = 60
    btnCollapse.Top = 34.5
    btnExpandAll.Font.Size = stdFontSize
    btnExpandAll.Height = stdButtonHeight
    btnExpandAll.Left = 674.25
    btnExpandAll.Width = 52.5
    btnExpandAll.Top = 34.5
    btnShowBlackLine.Font.Size = stdFontSize
    btnShowBlackLine.Height = stdButtonHeight
    btnShowBlackLine.Left = 679.5
    btnShowBlackLine.Width = 46.5
    btnShowBlackLine.Top = 60
    btnShowComm.Font.Size = stdFontSize
    btnShowComm.Height = stdButtonHeight
    btnShowComm.Left = 471.75
    btnShowComm.Width = 75.75
    btnShowComm.Top = 60
    btnShowFPA.Font.Size = stdFontSize
    btnShowFPA.Height = stdButtonHeight
    btnShowFPA.Left = 647.25
    btnShowFPA.Width = 30.75
    btnShowFPA.Top = 60
    btnShowGTC.Font.Size = stdFontSize
    btnShowGTC.Height = stdButtonHeight
    btnShowGTC.Left = 549
    btnShowGTC.Width = 33
    btnShowGTC.Top = 60
    btnShowHFM.Font.Size = stdFontSize
    btnShowHFM.Height = stdButtonHeight
    btnShowHFM.Left = 616.5
    btnShowHFM.Width = 29.35
    btnShowHFM.Top = 60
    btnShowITMgmt.Font.Size = stdFontSize
    btnShowITMgmt.Height = stdButtonHeight
    btnShowITMgmt.Left = 431.25
    btnShowITMgmt.Width = 39
    btnShowITMgmt.Top = 60
    btnShowPM.Font.Size = stdFontSize
    btnShowPM.Height = stdButtonHeight
    btnShowPM.Left = 403.5
    btnShowPM.Width = 26.25
    btnShowPM.Top = 60
    btnShowSMR.Font.Size = stdFontSize
    btnShowSMR.Height = stdButtonHeight
    btnShowSMR.Left = 583.5
    btnShowSMR.Width = 31.5
    btnShowSMR.Top = 60
End Sub
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
is your projector the same resolution as the laptop display
 
Upvote 0
No -- I've come to expect the buttons to get mangled when they go on the projector -- but even when I disconnect the projector and go back to just my original laptop display, then run the cleanup routine, the font sizes do not reset properly.
 
Upvote 0
you'll be running two different screen sizes, sometimes necessary to programme for worst case scenario
 
Upvote 0
But why, when I switch back to the original laptop display then explicitly set the font size to 8, doesn't the setting take effect?
 
Upvote 0

Forum statistics

Threads
1,225,383
Messages
6,184,642
Members
453,250
Latest member
unluckyuser

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top