Example #1
0
        //static public void show_special_list_modeless2(Form caller, KB9TextBox txtFocused)
        //{

        //    KB9TextBox t = txtFocused;
        //    if (t == null)
        //        return;

        //    frmSpecialKey frmKeyList = frmSpecialKey.Instance();
        //    //if (frmKeyList == null)
        //    //    frmKeyList = new frmSpecialKey();
        //    frmKeyList.TopMost = true;
        //    //set it initial position
        //    int dx = caller.Width;// -frmKeyList.Width;
        //    int dy = 0;//
        //    Point pt = caller.Location;
        //    pt.Offset(dx, dy);
        //    frmKeyList.Location = pt;
        //    frmKeyList.FocusedTextBox = t;
        //    if (frmKeyList.FocusedTextBox == null)
        //    {
        //        frmKeyList.Hide();

        //    }
        //    else
        //    {
        //        frmKeyList.Visible = false;
        //        frmKeyList.Show(caller);
        //    }
        //}

        static public void show_special_list_modeless(Form caller, KB9TextBox txtFocused)
        {
            KB9TextBox t = txtFocused;

            if (t == null)
            {
                return;
            }
            Control        c          = t.Parent;
            frmOnScreenKbd frmKeyList = frmOnScreenKbd.Instance();

            frmKeyList.TopMost = true;
            //set it initial position
            Point point = t.Location;

            point = c.PointToScreen(point);
            //point = caller.PointToClient(ppt);
            //point.X += t.Width;
            point.Y += t.Height;


            frmKeyList.Location       = point; //form location is screen coordinate
            frmKeyList.FocusedTextBox = t;
            if (frmKeyList.FocusedTextBox == null)
            {
                frmKeyList.Hide();
                //frmKeyList = null;
            }
            else
            {
                //if (!frmKeyList.Visible)
                frmKeyList.Visible = false;
                frmKeyList.Show(caller);
            }
        }
Example #2
0
        static public frmOnScreenKbd Instance()
        {
            if (frmForm == null)
            {
                frmForm = new frmOnScreenKbd();
            }

            return(frmForm);
        }
Example #3
0
 private void frmSpecialKey_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (_ForCombination)
     {
         return;
     }
     else
     {
         frmForm = null;
     }
 }
Example #4
0
        private void tsbSpecial_Click(object sender, EventArgs e)
        {
            KB9TextBox     t   = GetFocusedTextBox();
            frmOnScreenKbd frm = new frmOnScreenKbd(true);

            frm.StartPosition = FormStartPosition.CenterParent;
            string s = frm.InputSpecialKey();

            // s = s.Replace("[", "");
            // s = s.Replace("]", "");
            if (s.Length <= 0)
            {
                return;
            }
            t.AddKeyCode(s, false);
        }