当前位置: 首页>>代码示例>>C#>>正文


C# Forms.NumericUpDown类代码示例

本文整理汇总了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();
 }
开发者ID:hieu292,项目名称:ngocminh,代码行数:26,代码来源:QuyDinhCtrl.cs

示例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);
            }
        }
开发者ID:TuanBT,项目名称:FVC-Scoring-System,代码行数:34,代码来源:FillData.cs

示例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);
        }
开发者ID:aniPerezG,项目名称:barbalpha,代码行数:27,代码来源:TgcFloatModifier.cs

示例4: DefaultValues

		public void DefaultValues ()
		{
			NumericUpDown n = new NumericUpDown ();
#if NET_2_0
			Assert.IsFalse (n.Accelerations.IsReadOnly, "#A1");
#endif
		}
开发者ID:stabbylambda,项目名称:mono,代码行数:7,代码来源:NumericUpDownTest.cs

示例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);
 }
开发者ID:i2e-haw-hamburg,项目名称:opencascade,代码行数:38,代码来源:TransparencyDialog.cs

示例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();
            }
        }
开发者ID:AmrSaidam,项目名称:Amr,代码行数:29,代码来源:EditPriceForItem.cs

示例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;
        }
开发者ID:mcclymont,项目名称:ps360prodrummer,代码行数:33,代码来源:MultiNote.cs

示例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);
            }
        }
开发者ID:redhead,项目名称:CGenPlus,代码行数:25,代码来源:UnavaMgr.cs

示例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++;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:34,代码来源:frmItemBonus.cs

示例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;
 }
开发者ID:nahueld,项目名称:CoffeeAndCake,代码行数:8,代码来源:LibroHandler.cs

示例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++;
            }
        }
开发者ID:Sevenanths,项目名称:boson-t-nouveau,代码行数:27,代码来源:stagesparser.cs

示例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;
 }
开发者ID:AndrijMoroziuk,项目名称:course,代码行数:27,代码来源:Program.cs

示例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);
 }
开发者ID:AndrijMoroziuk,项目名称:course,代码行数:30,代码来源:Program.cs

示例14: Add

 public Add(NumericUpDown IN_toUpdate, string name)
 {
     InitializeComponent();
     toUpdate = IN_toUpdate;
     startingAmt.Value = toUpdate.Value;
     lblAddTo.Text = "Add To: " + name;
 }
开发者ID:JDiPierro,项目名称:BoatSheet,代码行数:7,代码来源:Add.cs

示例15: FixEmptyNumericUpDown

 private void FixEmptyNumericUpDown(NumericUpDown control)
 {
     if (control.Text == "")
     {
         control.Text = "0";
     }
 }
开发者ID:yukseljunk,项目名称:wps,代码行数:7,代码来源:frmOptions.cs


注:本文中的System.Windows.Forms.NumericUpDown类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。