Beispiel #1
0
        /// <summary>
        /// 根据消息类型显示消息内容
        /// </summary>
        /// <param name="messageType">
        /// 1--表示运动员在场上,2---表示运动员在场下
        /// </param>
        public MyPopUpWindow(MyPopUpWindowType messageType)
        {
            InitializeComponent();

            if (messageType == MyPopUpWindowType.OnCourt)
            {
                lblMessage.Text = "该运动员已经在场上";
            }
            else if (messageType == MyPopUpWindowType.OnBench)
            {
                lblMessage.Text = "该运动员已经在场下";
            }
        }
        private static void PopUpWindow(MyPopUpWindowType messageType)
        {
            MyPopUpWindow myPopupwindow = new MyPopUpWindow(messageType);
            int           LocationX     = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - myPopupwindow.Width;
            int           LocationY     = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - myPopupwindow.Height;

            System.Drawing.Point p = new System.Drawing.Point(LocationX, LocationY);
            myPopupwindow.PointToScreen(p);
            myPopupwindow.Location = p;
            myPopupwindow.Show();
            System.Threading.Thread.Sleep(200);
            myPopupwindow.Close();
        }