Occasionally, I\'ll happen across a spreadsheet which suffers from magic buttons or listboxes which get bigger or smaller over time.
Nothing in the code is instructi
My monitors all appear to be set at native resolutions, which deepens the mystery. However, I have found that doing SOMETHING to the button (moving or resizing) somehow fixes the problem. This routine automates the moving, and then restores the original setting.
The following code seems to address the problem, at least for buttons.
Public Sub StablizeButton(oButton As MSForms.CommandButton)
With oButton
' If True, then temporary distortion is remedied only by clicking somewhere.
' If False, then the temporary distortion is remedied merely by moving the mouse pointer away.
.TakeFocusOnClick = False
' For best results: In the Properties Sheet, initialize to False.
.Left = .Left + 200 ' Move the button 200 units to the right, ...
.Left = .Left - 200 ' ... and then move it back.
End With
End Sub
Invoke it as follows:
Private Sub MyButton_Click()
StablizeButton MyButton
' Remainder of code.
End Sub