|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace CrytsalReportsDemo
{
public partial class CheckNumericUpDown : UserControl
{
public CheckNumericUpDown()
{
InitializeComponent();
}
public delegate void ValueChangedHandler(object sender, EventArgs e);
public event ValueChangedHandler ValueChanged;
public decimal MinValue
{
get
{
return numericUpDown1.Minimum;
}
set
{
numericUpDown1.Minimum = value;
}
}
public decimal MaxValue
{
get
{
return numericUpDown1.Maximum;
}
set
{
numericUpDown1.Maximum = value;
}
}
public decimal Value
{
get
{
return numericUpDown1.Value;
}
set
{
numericUpDown1.Value = value;
}
}
public bool Checked
{
get
{
return checkBox1.Checked;
}
set
{
checkBox1.Checked = value;
}
}
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
if (ValueChanged != null)
{
ValueChanged(sender, e);
checkBox1.Checked = true;
}
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
numericUpDown1.Enabled = checkBox1.Checked;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Enthusiastic programmer/researcher, passionate to learn new technologies, interested in problem solving, data structures, algorithms, AI, machine learning and nlp.
Amateur guitarist/ keyboardist, squash player.