public MainWindow() { InitializeComponent(); main = new WinPos(); System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; WindowStartupLocation = WindowStartupLocation.CenterScreen; }
public WinPos GetChildPos(double h, double w) { WinPos child = new WinPos(); child.height = h < maxh ? h : maxh; child.top = this.top + 200; child.width = w < maxw ? w : maxw; //move to right of main window if won't go off the screen child.left = this.left + w < maxw ? this.left + w : this.left + 200; return child; }
public WinPos GetChildPos(double h, double w) { WinPos child = new WinPos(); child.height = h < maxh ? h : maxh; child.top = this.top + 200; child.width = w < maxw ? w : maxw; //move to right of main window if won't go off the screen child.left = this.left + w < maxw ? this.left + w : this.left + 200; return(child); }
private void AcquireVerificationClick(object sender, RoutedEventArgs e) { IDDAcquireAssay f = new IDDAcquireAssay(); WinPos childPos = main.GetChildPos(f.Height, f.Width); f.StartPosition = System.Windows.Forms.FormStartPosition.Manual; if (childPos.height < f.Height || childPos.width < f.Width) // Resize if it will go off screen. { f.Size = new System.Drawing.Size((int)childPos.width, (int)childPos.height); } f.Location = new System.Drawing.Point((int)childPos.left, (int)childPos.top); f.ShowDialog(); }
private void MaintainCollarClick(object sender, RoutedEventArgs e) { //HN -- Cross ref shown first, next button takes you to IDDCollarCal IDDCollarCrossRef f = new IDDCollarCrossRef(); WinPos childPos = main.GetChildPos(f.Height, f.Width); f.StartPosition = System.Windows.Forms.FormStartPosition.Manual; if (childPos.height < f.Height || childPos.width < f.Width) // Resize if it will go off screen. { f.Size = new System.Drawing.Size((int)childPos.width, (int)childPos.height); } f.Location = new System.Drawing.Point((int)childPos.left, (int)childPos.top); f.ShowDialog(); }