Newer
Older
RbFreqStand / RbFreqStandMeasure / home / SetDevTestDlg.cs
yangqianqian on 1 Apr 2021 2 KB ui almost
using Casic.Birmm.RbFreqStandMeasure.R_DataBase.Model;
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace Casic.Birmm.RbFreqStandMeasure.home
{
    public partial class SetDevTestDlg : Form
    {
        #region 无边框拖动效果/最小化窗口/关闭窗口
        [DllImport("user32.dll")]//拖动无窗体的控件
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
        public const int WM_SYSCOMMAND = 0x0112;
        public const int SC_MOVE = 0xF010;
        public const int HTCAPTION = 0x0002;
        private void panel1_MouseDown(object sender, MouseEventArgs e)
        {
            //拖动窗体
            ReleaseCapture();
            SendMessage(Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
        }
        #endregion

        public Action HideMaskAction
        {
            get;
            set;
        }

        public SetDevTestDlg()
        {
            InitializeComponent();

            groupBox3.Enabled = false;

        }

        // 开始检测
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (checkBox_stability.Checked && !checkBox_1s.Checked && !checkBox_10s.Checked && !checkBox_20s.Checked && !checkBox_100s.Checked)
            {
                MessageBox.Show("请选择频率稳定度!");
                return;
            }
            MessageBox.Show("已添加开始检测");
        }       

        private void btnExitDev_Click(object sender, EventArgs e)
        {
            this.HideMaskAction();
        }

        

        private void btn_downChannelList_Click(object sender, EventArgs e)
        {
            comboBox_channelNo.DroppedDown = true;
        }

        private void comboBox_channelNo_SelectedIndexChanged(object sender, EventArgs e)
        {
            text_channelNo.Text = comboBox_channelNo.SelectedItem.ToString();
        }

        private void checkBox_stability_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox_stability.Checked)
            {
                groupBox3.Enabled = true;
            }
            else
            {
                groupBox3.Enabled = false;
            }
        }

        // 选择开始时间后,自动计算结束时间
        private void timePicker_startTime_ValueChanged(object sender, EventArgs e)
        {

        }
        //选择结束时间后,与自动计算的结束时间进行对比
        private void timePicker_endTime_Click(object sender, EventArgs e)
        {

        }
    }
}