Beispiel #1
0
 private void NumericUpDown1_Enter(object sender, System.EventArgs e)
 {
     if (!frminptForm.Visible)
     {
         //frminptForm.CurrentUsedControl = NumericUpDown1;
         frminptForm.Show();
     }
 }
Beispiel #2
0
        private void ShowInputPanel(TextBox TargetControl)
        {
            Point controlLocation    = Point.Empty;
            Point inputPanelLocation = Point.Empty;

            controlLocation = TargetControl.PointToScreen(controlLocation);
            Rectangle ScreenWorkArea = Screen.FromPoint(controlLocation).WorkingArea;

            //If Not frminptForm.Visible Then
            frminptForm.CurrentUsedControl = TargetControl;
            inputPanelLocation.X           = controlLocation.X;
            inputPanelLocation.Y           = controlLocation.Y + 30;
            if (controlLocation.X + frminptForm.Width > ScreenWorkArea.Width)             //右边界超出屏幕
            {
                inputPanelLocation.X = ScreenWorkArea.Width - frminptForm.Width;
            }
            if (controlLocation.Y + TargetControl.Height + frminptForm.Height + 30 > ScreenWorkArea.Height)             //下边界超出屏幕
            {
                inputPanelLocation.Y = controlLocation.Y - 30 - frminptForm.Height;
            }
            if (controlLocation.X < 0)             //左边界超出屏幕
            {
                inputPanelLocation.X = 0;
            }
            frminptForm.SetBounds(inputPanelLocation.X, inputPanelLocation.Y, 592, 264);
            frminptForm.Show();
        }