123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System.ComponentModel;
- namespace System.Windows.Forms
- {
- public class NumericUpDown : Control, ISupportInitialize
- {
- protected new CustomControls.NumericUpDown control { get; }
- public decimal Value
- {
- get => control.Value;
- set => control.Value = value;
- }
- public decimal Minimum
- {
- get => control.Minimum;
- set => control.Minimum = value;
- }
- public decimal Maximum
- {
- get => control.Maximum;
- set => control.Maximum = value;
- }
- public decimal Increment
- {
- get => control.Increment;
- set => control.Increment = value;
- }
- public int DecimalPlaces
- {
- get => control.DecimalPlaces;
- set => control.DecimalPlaces = value;
- }
- public bool ThousandsSeparator { get; set; } // TODO?
- public bool Hexadecimal { get; set; } // TODO?
- public HorizontalAlignment TextAlign { get; set; } // TODO?
- public event EventHandler ValueChanged;
- protected override void SetControlHeight(int value)
- {
- // height is controlled by textbox part
- }
- public void BeginInit() { }
- public void EndInit() { }
- public NumericUpDown()
- {
- control = new();
- SetControl(control);
- control.ValueChanged += (sender, args) => ValueChanged?.Invoke(this, EventArgs.Empty);
- Height = 22;
- }
- }
- }
|