簡體   English   中英

如何為 NumericUpDown 定義負范圍

[英]how to define negative range for NumericUpDown

例如,我希望 NumericUpDown 范圍介於 (-100, 100) 之間,但由於 ) NumericUpDown 是十進制數量 (0, ......). 所以如何使 NumericUpDown 取負范圍。

在這里您可以復制粘貼並運行

numericUpDown1 = new NumericUpDown();
// Set the Minimum, Maximum, and initial Value.
numericUpDown1.Value = 0;
numericUpDown1.Maximum = 100;
numericUpDown1.Minimum = -100;

//You can set each click to increment number for next number, even in decimals (The default value is 1)
numericUpDown1.DecimalPlaces = 2;
numericUpDown1.Increment = 0.25M;

注意:@Chetan Ranpariya 給了我們正確的鏈接以供進一步閱讀。

閱讀鏈接 - Microsoft docs

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM