@@ -61,9 +61,9 @@ public InternalNumericUpDown(KryptonNumericUpDown kryptonNumericUpDown)
61
61
62
62
// Remove from view until size for the first time by the Krypton control
63
63
Size = Size . Empty ;
64
-
65
64
// We provide the border manually
66
65
BorderStyle = BorderStyle . None ;
66
+ Padding = Padding . Empty ;
67
67
}
68
68
69
69
public void SetChangingText ( bool value ) => ChangingText = value ;
@@ -100,6 +100,16 @@ public bool MouseOver
100
100
#endregion
101
101
102
102
#region Protected
103
+ /// <summary>Gets the length and height, in pixels, that is specified as the default minimum size of a control.</summary>
104
+ /// <returns>A <see cref="T:System.Drawing.Size" /> representing the size of the control.</returns>
105
+ protected override Size DefaultMinimumSize => GlobalStaticValues . DefaultMinimumSize ;
106
+
107
+ /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
108
+ protected override void OnSystemColorsChanged ( EventArgs e )
109
+ {
110
+ // DO nothing, It's Krypton Colours that are in use !
111
+ }
112
+
103
113
/// <summary>
104
114
/// Process Windows-based messages.
105
115
/// </summary>
@@ -590,8 +600,7 @@ protected override void WndProc(ref Message m)
590
600
}
591
601
592
602
// Draw the actual up and down buttons split inside the client rectangle
593
- DrawUpDownButtons ( g ,
594
- clientRect with { Height = clientRect . Height - 1 } ) ;
603
+ DrawUpDownButtons ( g , clientRect ) ;
595
604
596
605
// Now blit from the bitmap from the screen to the real dc
597
606
PI . BitBlt ( hdc , clientRect . X , clientRect . Y , clientRect . Width , clientRect . Height ,
@@ -853,11 +862,13 @@ public KryptonNumericUpDown()
853
862
{
854
863
DisplayPadding = new Padding ( 1 , 1 , 1 , 0 )
855
864
} ;
865
+ // When font is smaller than the Min size, then attempt to Vertical centralise the control
866
+ var layoutCentre = new ViewLayoutCenter ( _layoutFill ) ;
856
867
857
868
// Create inner view for placing inside the drawing docker
858
869
_drawDockerInner = new ViewLayoutDocker
859
870
{
860
- { _layoutFill , ViewDockStyle . Fill }
871
+ { layoutCentre , ViewDockStyle . Fill }
861
872
} ;
862
873
863
874
// Create view for the control border and background
@@ -1383,7 +1394,7 @@ public ButtonStyle UpDownButtonStyle
1383
1394
/// </summary>
1384
1395
/// <param name="start">The position of the first character in the current text selection within the text box.</param>
1385
1396
/// <param name="length">The number of characters to select.</param>
1386
- public void Select ( int start , int length ) => _numericUpDown ? . Select ( start , length ) ;
1397
+ public void Select ( int start , int length ) => _numericUpDown . Select ( start , length ) ;
1387
1398
1388
1399
/// <summary>
1389
1400
/// Sets the fixed state of the control.
@@ -1733,7 +1744,7 @@ protected override void OnLayout(LayoutEventArgs levent)
1733
1744
if ( IsHandleCreated || _forcedLayout || ( DesignMode && ( _numericUpDown != null ) ) )
1734
1745
{
1735
1746
Rectangle fillRect = _layoutFill . FillRect ;
1736
- _numericUpDown ? . SetBounds ( fillRect . X , fillRect . Y , fillRect . Width , fillRect . Height ) ;
1747
+ _numericUpDown . SetBounds ( fillRect . X , fillRect . Y , fillRect . Width , fillRect . Height ) ;
1737
1748
}
1738
1749
}
1739
1750
}
@@ -1769,7 +1780,7 @@ protected override void OnMouseLeave(EventArgs e)
1769
1780
protected override void OnGotFocus ( EventArgs e )
1770
1781
{
1771
1782
base . OnGotFocus ( e ) ;
1772
- _numericUpDown ? . Focus ( ) ;
1783
+ _numericUpDown . Focus ( ) ;
1773
1784
}
1774
1785
1775
1786
/// <summary>
0 commit comments