本文整理汇总了C#中System.Windows.Forms.NumericUpDown类的典型用法代码示例。如果您正苦于以下问题:C# NumericUpDown类的具体用法?C# NumericUpDown怎么用?C# NumericUpDown使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NumericUpDown类属于System.Windows.Forms命名空间,在下文中一共展示了NumericUpDown类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HienThi
//QuyDinhData m_QuyDinhData = new QuyDinhData();
public void HienThi(TextBox txtTenCongTy,
TextBox txtDiaChi,
TextBox txtDienThoai,
Label lblTaiKhoanCo,
NumericUpDown nudLichSaoLuu,
TextBox txtViTriSaoLuu,
Label lblThoiDiemSaoLuu,
RadioButton rdbBat,
RadioButton rdbTat)
{
DataTable dT = QuyDinh.LayDsQuyDinh();
if (dT.Rows.Count == 0) return;
int timKiemTuDong = Convert.ToInt32(dT.Rows[0]["TimKiemTuDong"]);
if (timKiemTuDong==1)
rdbBat.Checked = true;
else
rdbTat.Checked = true;
txtTenCongTy.Text = dT.Rows[0]["TenCongTy"].ToString();
txtDiaChi.Text = dT.Rows[0]["DiaChi"].ToString();
txtDienThoai.Text = dT.Rows[0]["DienThoai"].ToString();
lblTaiKhoanCo.Text = dT.Rows[0]["TaiKhoanCo"].ToString();
nudLichSaoLuu.Value = Convert.ToInt32(dT.Rows[0]["LichSaoLuu"]);
txtViTriSaoLuu.Text = dT.Rows[0]["ViTriSaoLuu"].ToString();
lblThoiDiemSaoLuu.Text = dT.Rows[0]["ThoiDiemSaoLuuTiepTheo"].ToString();
}
示例2: FillFromMatch
public void FillFromMatch(NumericUpDown nmrNumberMatch)
{
string figIdRed = "";
string figIdBlue = "";
string matchString = nmrNumberMatch.Value.ToString();
try
{
var match = new Match();
match = TextDataUltil.GetMatchFromMatchId(matchString);
if (match != null)
{
figIdRed = match.FigIdRed;
figIdBlue = match.FigIdBlue;
if (checkIsNumber(figIdRed))
figIdRed = setMSSVFromMath(figIdRed);
if (checkIsNumber(figIdBlue))
figIdBlue = setMSSVFromMath(figIdBlue);
setValuesTextboxRed(figIdRed);
setValuesTextboxBlue(figIdBlue);
}
else
{
ClearTexbox();
}
}
catch (Exception fail)
{
String error = "The following error has occurred:\n\n";
error += fail.Message.ToString() + "\n\n";
MessageBox.Show(error);
}
}
示例3: TgcFloatModifier
public TgcFloatModifier(string varName, float minValue, float maxValue, float defaultValue) : base(varName)
{
this.minValue = minValue;
this.maxValue = maxValue;
numericUpDown = new NumericUpDown();
numericUpDown.Size = new System.Drawing.Size(100, 20);
numericUpDown.Margin = new Padding(0);
numericUpDown.DecimalPlaces = 4;
numericUpDown.Minimum = (decimal)minValue;
numericUpDown.Maximum = (decimal)maxValue;
numericUpDown.Value = (decimal)defaultValue;
numericUpDown.Increment = (decimal)(2f * (maxValue - minValue) / 100f);
numericUpDown.ValueChanged += new EventHandler(numericUpDown_ValueChanged);
trackBar = new TrackBar();
trackBar.Size = new System.Drawing.Size(100, 20);
trackBar.Margin = new Padding(0);
trackBar.Minimum = 0;
trackBar.Maximum = 20;
trackBar.Value = (int)((defaultValue - minValue) * 20 / (maxValue - minValue));
trackBar.ValueChanged += new EventHandler(trackBar_ValueChanged);
contentPanel.Controls.Add(numericUpDown);
contentPanel.Controls.Add(trackBar);
}
示例4: DefaultValues
public void DefaultValues ()
{
NumericUpDown n = new NumericUpDown ();
#if NET_2_0
Assert.IsFalse (n.Accelerations.IsReadOnly, "#A1");
#endif
}
示例5: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TransparencyDialog));
this.MyTransparency = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).BeginInit();
this.SuspendLayout();
//
// MyTransparency
//
this.MyTransparency.Location = new System.Drawing.Point(16, 16);
this.MyTransparency.Maximum = new System.Decimal(new int[] {
10,
0,
0,
0});
this.MyTransparency.Name = "MyTransparency";
this.MyTransparency.Size = new System.Drawing.Size(96, 20);
this.MyTransparency.TabIndex = 0;
this.MyTransparency.ValueChanged += new System.EventHandler(this.MyTransparency_ValueChanged);
//
// TransparencyDialog
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(128, 53);
this.Controls.Add(this.MyTransparency);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "TransparencyDialog";
this.Text = "TransparencyDialog";
((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).EndInit();
this.ResumeLayout(false);
}
示例6: editPrice
public void editPrice(TextBox textBox1,ComboBox comboBox1,NumericUpDown selectAmount)
{
try
{
connect = DataBaseConnection.getInstance().getConnect();
SqlCommand cmd = new SqlCommand("update [Table] set [Price] = @Price , [Amount] = @Amount where [Name] = @Name", connect);
// cmd.CommandText = "update [Table] set [Price] = @Price where [Name] = @Name";
cmd.Parameters.AddWithValue("@Price", float.Parse(textBox1.Text));
cmd.Parameters.AddWithValue("@Name", comboBox1.Text);
cmd.Parameters.AddWithValue("@Amount", Convert.ToInt32(selectAmount.Value));
connect.Open();
cmd.ExecuteNonQuery();
MessageBox.Show("The product was Edited !! " + comboBox1.Text, "Done", MessageBoxButtons.OK, MessageBoxIcon.Information);
ShowMessages.PutMessageInContainer("The "+comboBox1+" information was updated", Color.Plum);
connect.Close();
}
catch (Exception EX)
{
MessageBox.Show(EX.StackTrace.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
ShowMessages.PutMessageInContainer("Error within Edit Operaiton ", Color.Red);
}
finally
{
connect.Close();
UpdateGridView.UpdateGridViews();
}
}
示例7: MultiNoteGui
public MultiNoteGui(ComboBox ddlVelCheck, NumericUpDown nupVelCheck,
ComboBox ddlNote, NumericUpDown nupNoteTo,
NumericUpDown nupVelMult, NumericUpDown nupVelAdd,
Button btnAdd, Button btnRemove,
ListBox lb)
{
m_ddlVelCheck = ddlVelCheck;
m_ddlVelCheck.Items.Add(MultNoteCheckType.Greater);
m_ddlVelCheck.Items.Add(MultNoteCheckType.Lesser);
m_ddlVelCheck.SelectedIndex = 0;
m_nupVelCheck = nupVelCheck;
m_ddlNote = ddlNote;
m_ddlNote.Items.Add(GuiDrumPad.RedTom);
m_ddlNote.Items.Add(GuiDrumPad.YellowTom);
m_ddlNote.Items.Add(GuiDrumPad.YellowCymbal);
m_ddlNote.Items.Add(GuiDrumPad.BlueTom);
m_ddlNote.Items.Add(GuiDrumPad.BlueCymbal);
m_ddlNote.Items.Add(GuiDrumPad.GreenTom);
m_ddlNote.Items.Add(GuiDrumPad.GreenCymbal);
m_ddlNote.SelectedIndex = 0;
m_nupNoteTo = nupNoteTo;
m_nupVelMult = nupVelMult;
m_nupVelAdd = nupVelAdd;
m_btnAdd = btnAdd;
m_btnAdd.Click += new EventHandler(m_btnAdd_Click);
m_btnRemove = btnRemove;
m_btnRemove.Click += new EventHandler(m_btnRemove_Click);
m_lb = lb;
}
示例8: UnavaMgr
public UnavaMgr(Postava pos, Label muL, NumericUpDown unN, FlowLayoutPanel bars, Panel labels, LinkLabel postihULink, Label postihUL)
{
postava = pos;
unavaPanel = bars;
mezUnavyL = muL;
unavaLabels = labels;
unavaN = unN;
postihLink = postihULink;
postihL = postihUL;
int mez = postava.getVlastnostO("Mez únavy");
boxes = new List<CheckBox>();
for (int i = 0; i < mez * 3; i++)
{
CheckBox box = new CheckBox();
//box.ThreeState = true;
box.Checked = false;
box.Margin = new Padding(0);
box.Parent = unavaPanel;
box.Width = box.Height = 15;
box.Click += new EventHandler(changeCheck);
box.Tag = i+1;
boxes.Add(box);
}
}
示例9: AddControlRow
private void AddControlRow() {
int yMod = mBonusCount + 1;
Label lbl = new Label();
lbl.AutoSize = true;
lbl.Location = new System.Drawing.Point( 12, 30 + ( 37 * yMod ) + 7 + 3 );
lbl.Name = "lbl" + mBonusCount;
lbl.Size = new System.Drawing.Size( 46, 13 );
lbl.Text = "Bonus " + ( mBonusCount + 1 );
ComboBox com = new ComboBox();
com.FormattingEnabled = true;
com.Location = new System.Drawing.Point( 64, 30 + ( 37 * yMod ) + 7 );
com.Name = "cb" + mBonusCount;
com.Size = new System.Drawing.Size( 79, 21 );
com.Items.AddRange( mComboValues );
com.SelectedIndex = 0;
NumericUpDown num = new NumericUpDown();
num.Location = new System.Drawing.Point( 149, 30 + ( 37 * yMod ) + 7 );
num.Name = "num" + mBonusCount;
num.Size = new System.Drawing.Size( 52, 20 );
num.Minimum = -1000;
num.Maximum = 1000;
num.Value = 0;
this.Controls.Add( lbl );
this.Controls.Add( num );
this.Controls.Add( com );
this.Height = 145 + ( yMod * 37 );
mBonusCount++;
}
示例10: LibroHandler
//Constructor
public LibroHandler(Element.NumericUpDown updwLibro, Element.NumericUpDown updwRenglon, Element.MaskedTextBox txtNroFolio, Element.TextBox txtDescripcion)
{
this.updwLibro = updwLibro;
this.updwRenglon = updwRenglon;
this.txtNroFolio = txtNroFolio;
this.txtDescripcion = txtDescripcion;
}
示例11: loadVariablesNouveau
public void loadVariablesNouveau(NumericUpDown nudInitSpeed, NumericUpDown nudMaxSpeed, NumericUpDown nudEnergyInterval, NumericUpDown nudEnergySpeedup, NumericUpDown nudLevelDepth, TextBox txtParticleName, TextBox txtParticleAbbv)
{
string[] stageslines = File.ReadAllLines(stagespath);
int linecount = 0;
foreach (string line in stageslines)
{
if (line.Contains("-- STAGE 1"))
{
int extra = 0;
if (stageslines[linecount + 1].Contains("{"))
{
extra = 1;
}
nudInitSpeed.Value = Convert.ToDecimal(stageslines[linecount + extra + 1].Split('=')[1].Trim().Replace(",", "").Replace('.', ','));
nudMaxSpeed.Value = Convert.ToDecimal(stageslines[linecount + extra + 2].Split('=')[1].Trim().Replace(",", "").Replace('.', ','));
nudEnergyInterval.Value = Convert.ToDecimal(stageslines[linecount + extra + 3].Split('=')[1].Trim().Replace(",", "").Replace('.', ','));
nudEnergySpeedup.Value = Convert.ToDecimal(stageslines[linecount + extra + 4].Split('=')[1].Trim().Replace(",", "").Replace('.', ','));
nudLevelDepth.Value = Convert.ToDecimal(stageslines[linecount + extra + 5].Split('=')[1].Trim().Replace(",", "").Replace('.', ','));
txtParticleName.Text = stageslines[linecount + extra + 6].Split('=')[1].Trim().Replace("\"", "").Replace(",", "");
txtParticleAbbv.Text = stageslines[linecount + extra + 7].Split('=')[1].Trim().Replace("\"", "").Replace(",", "");
}
linecount++;
}
}
示例12: Nul
public void Nul(NumericUpDown n1, NumericUpDown n2, NumericUpDown n3, NumericUpDown n4, NumericUpDown n5, NumericUpDown n6, NumericUpDown n7, NumericUpDown n8, NumericUpDown n9, NumericUpDown n10, NumericUpDown n11, NumericUpDown n12, NumericUpDown n13, NumericUpDown n14, NumericUpDown n15, NumericUpDown n16, NumericUpDown n17, NumericUpDown n18, NumericUpDown n19, NumericUpDown n20, NumericUpDown n21, NumericUpDown n22, NumericUpDown n23, NumericUpDown n24)
{
n1.Value = 0;
n2.Value = 0;
n3.Value = 0;
n4.Value = 0;
n5.Value = 0;
n6.Value = 0;
n7.Value = 0;
n8.Value = 0;
n9.Value = 0;
n10.Value = 0;
n11.Value = 0;
n12.Value = 0;
n13.Value = 0;
n14.Value = 0;
n15.Value = 0;
n16.Value = 0;
n17.Value = 0;
n18.Value = 0;
n19.Value = 0;
n20.Value = 0;
n21.Value = 0;
n22.Value = 0;
n23.Value = 0;
n24.Value = 0;
}
示例13: Results
public void Results(NumericUpDown hometeam, NumericUpDown visitors, int ho, int vo, Team t1, Team t2)
{
sc1 = hometeam.Value;
sc2 = visitors.Value;
t1.ScoreMissedGoal(sc1, sc2);
t2.ScoreMissedGoal(sc2, sc1);
if (sc1 == sc2)
{
ho += 1;
vo += 1;
t1.Draws(1);
t2.Draws(1);
}
else if (sc1 > sc2)
{
ho += 3;
vo += 0;
t1.Wins(1);
t2.Loses(1);
}
else if (sc1 < sc2)
{
ho += 0;
vo += 3;
t1.Loses(1);
t2.Wins(1);
}
t1.Points(ho);
t2.Points(vo);
}
示例14: Add
public Add(NumericUpDown IN_toUpdate, string name)
{
InitializeComponent();
toUpdate = IN_toUpdate;
startingAmt.Value = toUpdate.Value;
lblAddTo.Text = "Add To: " + name;
}
示例15: FixEmptyNumericUpDown
private void FixEmptyNumericUpDown(NumericUpDown control)
{
if (control.Text == "")
{
control.Text = "0";
}
}