Reputation: 73
I have a userform with several frames, labels, and textboxes, all set to a default font of Calibri Regular size 10. I noticed the font in one textbox was different than the rest; a bit slimmer, a hair shorter and more condensed than the default. I tried adjusting the font in design and runtime, messing with the font of the frame, and replacing the textbox with a new one, but nothing seems to correct the font.
Then, by accident, I moved the textbox position up a bit and the font automagically corrected itself. Weird. I've since been playing around with the textbox position and frame size. This is what I've observed:
1) The font size is dependent on the relative position within the frame; the textbox needs to be entirely in the top 50% of the frame height, and adjusting the textbox position OR frame height affects the font.
2) This issue applies to more than one frame on this userform.
3) This issue applies to labels as well as textboxes.
4) This issue is inconsistent and does NOT apply to all textboxes and labels; it's just the textboxes affected in the first frame, just the labels in a second frame, and there is no font issue in a third frame.
I've gone over the properties in all frames, labels, and textboxes in design mode and nothing stands out. All of these controls have the same font set. Has anyone ever encountered this issue before? Is this a known bug?
Upvotes: 2
Views: 1791
Reputation: 21
I also had success changing my textbox heights from 17.5 to 18. In my case I also had them slightly overlapping (to create a table effect), which despite them being 18 font, still caused them to have a slightly larger text size. After I changed it so that the bottom of one is the top of another, everything seems to be working fine now.
Upvotes: 1
Reputation: 26
Same as @SquirrelBait - I too have found that the display size of the font changes in appearance depending on where it is positioned on my UserForm (created at Design time - Excel 2016). This occurred within a Multipage, but may not be relevant.
Although I don't have a solution, I may have a possible work around:
The issue only seems to occur where the Height of the Form Control (Label, TextBox, ComboBox) isn't an integer value. I auto sized some of my Controls so they were given Heights of 14.25, 28.5, 20.25 etc. I've increased all the Heights to integer values. Now the issue appears to be resolved.
Upvotes: 1