06-18-2014 03:47 AM
When MinHeight=23 I think the spin buttons are too small. If I change to MinHeight=25 the input box is increased in height but the spin buttons remain small.
Now I can solve this by setting Height=25, the spin buttons are then enlaged, but then the input box will not grow if the a larger font is used. I have also noticed that, if Height=Auto, a lager pont will enlage the spin buttons.
How can I have a NumericTextBoxDouble with automatically adjusted height but with buttons at least as large as when Height=25?
06-18-2014 11:14 AM
I was able to reproduce the sizing behavior you are seeing, and have created a task to fix the issue. It appears the buttons only size correctly when height is specified explicitly.
As a workaround, here is a custom text box that automatically sets its height to the desired value:
public class CustomTextBox : NumericTextBoxDouble {
protected override Size MeasureOverride( Size constraint ) {
Size desiredSize = base.MeasureOverride( new Size( double.PositiveInfinity, double.PositiveInfinity ) );
double desiredHeight = Math.Ceiling( desiredSize.Height );
if( Height != desiredHeight )
Dispatcher.BeginInvoke( new Action<double>( v => Height = v ), desiredHeight );
return desiredSize;
}
}
Note that this does not work with the minimum height, but will respond to changes in font size, and should improve the default sizing behavior.
08-11-2015
01:05 PM
- last edited on
11-20-2024
10:23 AM
by
Content Cleaner
Just wanted to let you know this issue (#478586) was fixed in the Measurement Studio 2015 release.