Exemple #1
0
        private void btnAddSendList_Click(object sender, EventArgs e)
        {
            //if (panelSendParam.Visible == false)
            //{

            //    panelSendParam.Visible = true;


            //    btnAddSendList.Image = Properties.Resources.round_minus;
            //    //btnAddSendList.Enabled = false;
            //    btnDeleteSendList.Enabled = false;
            //    btnSetupSendList.Enabled = false;
            //    btnSetdownSendList.Enabled = false;

            //    OpenParamSet(sender, e);
            //}
            //else
            //{
            //    panelSendParam.Visible = false;


            //    btnAddSendList.Image = Properties.Resources.round_plus;
            //    //btnAddSendList.Enabled = false;
            //    btnDeleteSendList.Enabled = true;
            //    btnSetupSendList.Enabled = true;
            //    btnSetdownSendList.Enabled = true;

            //    CloseParamSet(sender, e);
            //}

            bool topMost = this.ParentForm.TopMost;

            this.ParentForm.TopMost = false;

            frmQueueSetting frm = new frmQueueSetting();

            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                QueueSendObject obj = frm.SendObject;

                object[] array = new object[5];
                array[0] = dgvSendList.Rows.Count;
                array[1] = obj.Title;
                array[2] = obj.Enable;
                array[3] = obj.Mode;
                array[4] = obj.Content;
                dgvSendList.Rows.Add(array);
            }

            this.ParentForm.TopMost = topMost;
        }
Exemple #2
0
        private void dgvSendList_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }

            if (e.RowIndex >= dgvSendList.RowCount ||
                e.ColumnIndex == 1 || e.ColumnIndex == 2)    // 发送列和使能列不允许双击操作
            {
                return;
            }


            DataGridViewRow row = dgvSendList.Rows[e.RowIndex];

            object[] items = new object[row.Cells.Count];
            for (int i = 0; i < items.Length; i++)
            {
                items[i] = row.Cells[i].Value;
            }


            bool topMost = this.ParentForm.TopMost;

            this.ParentForm.TopMost = false;

            frmQueueSetting frm = new frmQueueSetting(items);

            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                QueueSendObject obj = frm.SendObject;
                row.Cells[1].Value = obj.Title;
                row.Cells[2].Value = obj.Enable;
                row.Cells[3].Value = obj.Mode;
                row.Cells[4].Value = obj.Content;
            }

            this.ParentForm.TopMost = topMost;
        }