public void setShow() { MainForm.Instance.autoHideEn(true); canDone = true; Show(); SeBox.Focus(); Tools.SetForegroundWindow(Handle); }
/// <summary> /// 输入框“文字改变” /// </summary> private void SeBox_TextChanged(object sender, EventArgs e) { if (SeBox.Text == "") { clearItemBox(); setSearchMode(ItemNameMode.Instance); ItemIntroduce.Text = ""; SeBox.Focus(); } else { setSearchResult(); } }
/// <summary> /// 按下按键(不包括 UP DOWN RIGHT LEFT 需要在窗口行为中重写的系统键行为中处理) /// </summary> private void itemBox_KeyDown(object sender, KeyEventArgs e) { ItemBox ib = sender as ItemBox; switch (e.KeyCode) { case Keys.Enter: ib.Execute(); break; case Keys.Alt: case Keys.Menu: break; case Keys.Apps: break; case Keys.Space: #region 空格 if (isItemMode(nowSeMode)) { // this.done = false; Hide(); Item.Item.Edit(ib.Tag.ToString()); setDone(); } else if (nowSeMode is XiaoChaoMode) { // this.done = false; Hide(); Item.XiaoChao.editXC(ib.Tag.ToString()); setDone(); } break; #endregion default: SeBox.Focus(); break; } }
//----------设置页面 /// <summary> /// 传入新的项目数据表列表(无需处理重复) /// </summary> /// <param name="dt"></param> void RestItemBox(DataTable dt) { SeBox.Focus(); if (dt == null) { clearItemBox(); return; } if (dt.Rows.Count == 0) { clearItemBox(); return; } //去除重复的项目 DataView dv = new DataView(dt); pageDT = dv.ToTable(true, nowSeMode.needColumn); currentlyPage = 0; countPage = (int)Math.Ceiling((double)pageDT.Rows.Count / 9); nextPage(); }
//重写系统键处理方式 protected override bool ProcessDialogKey(Keys keyData) { switch (keyData) { case Keys.Tab: if (altMode.Checked) { title_Label.Text = "切换至:" + imeMode.Text; imeMode.Checked = true; } else { title_Label.Text = "切换至:" + altMode.Text; altMode.Checked = true; } return(true); case Keys.Up: if (itemBox1.Focused) { if (currentlyPage > 1) { if (lastPage()) { itemBox9.Focus(); return(true); } } else { SeBox.Focus(); } return(true); } break; case Keys.Down: if (currentlyPage < countPage) { if (itemBox9.Focused) { if (nextPage()) { itemBox1.Focus(); return(true); } } } break; case Keys.Right: if (nowSelectItemBox != null) { if (nowSelectItemBox.ContextMenuStrip != null) { Point screenPoint = PointToScreen(nowSelectItemBox.Location); screenPoint.X += 20; screenPoint.Y += 38; nowSelectItemBox.ContextMenuStrip.Show(screenPoint); return(true); } } break; case Keys.Left: if (isItemMode(nowSeMode)) { setItemInfo(nowSelectItemBox.Tag.ToString()); setDone(); } break; } return(base.ProcessDialogKey(keyData)); }
private void NextPateButton_Enter(object sender, EventArgs e) { SeBox.Focus(); }