Ejemplo n.º 1
0
 // 窗体鼠标按下事件
 private void frmMain_MouseDown(object sender, MouseEventArgs e)
 {
     // 调用事件
     if (!CharmControl.MouseDownEvent(e, CharmControls, this))
     {
         APIOperation.MoveNoBorderForm(this, e);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 引发 Paint 事件
        /// </summary>
        /// <param name="e">包含事件数据的 PaintEventArgs</param>
        protected override void OnPaint(PaintEventArgs e)
        {
            // 设置按钮全不可见
            for (int i = 0; i < 3; i++)
            {
                CharmControls[i].Visible = false;
            }

            // 设置消息框按钮
            switch (mButtonType)
            {
            case MessageBoxButtons.AbortRetryIgnore:
                CharmControls[0].Text    = "终止";
                CharmControls[0].Visible = true;
                CharmControls[1].Text    = "重试";
                CharmControls[1].Visible = true;
                CharmControls[2].Text    = "忽略";
                CharmControls[2].Visible = true;
                break;

            case MessageBoxButtons.OK:
                CharmControls[2].Text    = "确定";
                CharmControls[2].Visible = true;
                break;

            case MessageBoxButtons.OKCancel:
                CharmControls[1].Text    = "确定";
                CharmControls[1].Visible = true;
                CharmControls[2].Text    = "取消";
                CharmControls[2].Visible = true;
                break;

            case MessageBoxButtons.RetryCancel:
                CharmControls[1].Text    = "重试";
                CharmControls[1].Visible = true;
                CharmControls[2].Text    = "取消";
                CharmControls[2].Visible = true;
                break;

            case MessageBoxButtons.YesNo:
                CharmControls[1].Text    = "是";
                CharmControls[1].Visible = true;
                CharmControls[2].Text    = "否";
                CharmControls[2].Visible = true;
                break;

            case MessageBoxButtons.YesNoCancel:
                CharmControls[0].Text    = "是";
                CharmControls[0].Visible = true;
                CharmControls[1].Text    = "否";
                CharmControls[1].Visible = true;
                CharmControls[2].Text    = "取消";
                CharmControls[2].Visible = true;
                break;
            }

            CharmControl.PaintEvent(e.Graphics, CharmControls);
        }
Ejemplo n.º 3
0
 // 窗体鼠标弹起事件
 private void frmMain_MouseUp(object sender, MouseEventArgs e)
 {
     CharmControl.MouseUpEvent(e, CharmControls, this);
 }
Ejemplo n.º 4
0
 // 窗体鼠标移动事件
 private void frmMain_MouseMove(object sender, MouseEventArgs e)
 {
     CharmControl.MouseMoveEvent(e, CharmControls, this, mToolTip);
 }
Ejemplo n.º 5
0
 // 窗体鼠标单击事件
 private void frmMain_MouseClick(object sender, MouseEventArgs e)
 {
     CharmControl.MouseClickEvent(e, CharmControls);
 }
 /// <summary>
 /// 按照子控件的 Tab 键顺序向前或向后检索下一个控件
 /// </summary>
 /// <param name="cctl">从其上开始搜索的 CharmControl</param>
 /// <param name="forward">如果是 true,则按 Tab 键顺序向前搜索;如果是 false 则向后搜索</param>
 /// <returns>Tab 键顺序指定的下一个 CharmControl</returns>
 public CharmControl GetNextControl(
     CharmControl cctl,
     bool forward)
 {
     return new CharmControl();
 }
 /// <summary>
 /// 检索一个值,该值指示指定控件是否为一个控件的子控件
 /// </summary>
 /// <param name="cctl">要计算的 CharmControl</param>
 /// <returns>如果指定控件是控件的子控件,则为 true;否则为 false</returns>
 public bool Contains(
     CharmControl cctl)
 {
     return true;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 按照子控件的 Tab 键顺序向前或向后检索下一个控件
 /// </summary>
 /// <param name="cctl">从其上开始搜索的 CharmControl</param>
 /// <param name="forward">如果是 true,则按 Tab 键顺序向前搜索;如果是 false 则向后搜索</param>
 /// <returns>Tab 键顺序指定的下一个 CharmControl</returns>
 public CharmControl GetNextControl(
     CharmControl cctl,
     bool forward)
 {
     return(new CharmControl());
 }
Ejemplo n.º 9
0
 /// <summary>
 /// 检索一个值,该值指示指定控件是否为一个控件的子控件
 /// </summary>
 /// <param name="cctl">要计算的 CharmControl</param>
 /// <returns>如果指定控件是控件的子控件,则为 true;否则为 false</returns>
 public bool Contains(
     CharmControl cctl)
 {
     return(true);
 }