lixiaojun
2024-07-11 8d8cd298ab46aee191baf53ff320fd3290d1ec9a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
 
namespace IStation.WinFrmUI
{
    public partial class SetDoubleDlg : DevExpress.XtraEditors.XtraForm
    {
        public SetDoubleDlg()
        {
            InitializeComponent();
        }
 
        public void IsInt()
        {
            spinEdit1.Properties.IsFloatValue = false;
        }
 
        public double Number { get { return Convert.ToDouble(spinEdit1.Value); } set { spinEdit1.Value = Convert.ToDecimal(value); } }
        //{ get { return spinEdit1.GetValue(); } set { spinEdit1.SetValue(value); } }
        public void SetNumberRange(double min,double max)
        {  
            spinEdit1.Properties.MinValue = Convert.ToDecimal( min);
            spinEdit1.Properties.MaxValue = Convert.ToDecimal(max);   
        }
 
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }
 
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
 
        private void OnDlgLoad(object sender, EventArgs e)
        {
            spinEdit1.Focus();
            spinEdit1.SelectAll();
        }
 
        private void SetDoubleDlg_Shown(object sender, EventArgs e)
        {
            spinEdit1.Focus();
            spinEdit1.SelectAll();
        }
    }
}