private void simpleButton7_Click(object sender, EventArgs e) { frm库存查询 frmQuery = new frm库存查询(); frmQuery.FormBorderStyle = FormBorderStyle.FixedSingle; frmQuery.Width = 900; frmQuery.Height = 300; frmQuery.ShowIcon = false; int x = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width - frmQuery.Width; int y = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height - frmQuery.Height; Point p = new Point(x, y); frmQuery.PointToScreen(p); frmQuery.Location = p; frmQuery.TopMost = true; frmQuery.Show(); // frmQuery.StartPosition = FormStartPosition.CenterParent; // frmQuery.ShowDialog(); }
public static void ShowQuery(bool bShow = true) { if (frmQuery.Visible) { frmQuery.Close(); frmQuery = new frm库存查询(); frmQuery.FormBorderStyle = FormBorderStyle.FixedSingle; frmQuery.Width = 900; frmQuery.Height = 300; frmQuery.ShowIcon = false; int x = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width - frmQuery.Width; int y = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height - frmQuery.Height; Point p = new Point(x, y); frmQuery.PointToScreen(p); frmQuery.Location = p; frmQuery.TopMost = true; frmQuery.Show(); } else if (bShow) { frmQuery = new frm库存查询(); frmQuery.FormBorderStyle = FormBorderStyle.FixedSingle; frmQuery.Width = 900; frmQuery.Height = 300; frmQuery.ShowIcon = false; int x = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width - frmQuery.Width; int y = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height - frmQuery.Height; Point p = new Point(x, y); frmQuery.PointToScreen(p); frmQuery.Location = p; frmQuery.TopMost = true; frmQuery.Show(); } }