當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。