public void DisplayMessageBoxImage(Bitmap imageToDisplay) { m_MessageBoxImage.Close(); if (this.WindowState == FormWindowState.Minimized || m_bIsMainFormActive == false) { return; } int imageTimeout = Convert.ToInt32(textBoxTimeOut.Text);; // 5 secs int imgHeight = 600; int imgWidth = 300; Rectangle rect = this.Bounds; Point px = new Point(rect.Right, rect.Top); Point screenLocation = PointToScreen(px); m_MessageBoxImage.SetImage(imageToDisplay); m_MessageBoxImage.SetImgSize(imgHeight, imgWidth); int pixelOffset = 400; m_MessageBoxImage.SetImgLocation(screenLocation.X - (imgWidth + pixelOffset), screenLocation.Y); m_MessageBoxImage.SetImgLocation(px.X - pixelOffset, px.Y + 50); m_MessageBoxImage.Show(imageTimeout); }
void DisplayPopupDialogImageTest(ToolStripButton button) { if (this.WindowState == FormWindowState.Minimized || m_bIsMainFormActive == false) { return; } FloatingImage m_floatingImageDlg = new FloatingImage(); int imgHeight = 600; int imgWidth = 300; Rectangle rect = button.Bounds; Point px = new Point(rect.Left, rect.Bottom); Point screenLocation = PointToScreen(px); //Point.Empty); //m_floatingImageDlg.SetImage(global::ECPApp.Properties.Resources.diag_arrow_up_right128); //m_floatingImageDlg.SetImage(global::ECPApp.Properties.Resources.text_popup_dialog); m_floatingImageDlg.SetImgSize(imgHeight, imgWidth); //m_floatingImageDlg.SetImgLocation(screenLocation.X - (imgWidth / 2), screenLocation.Y - imgHeight); //m_floatingImageDlg.SetImgLocation(screenLocation.X - imgWidth, screenLocation.Y - (imgWidth / 2)); m_floatingImageDlg.SetImgLocation(screenLocation.X + imgWidth, screenLocation.Y); int imageTimeout = 5000; // 4 secs m_floatingImageDlg.Show(imageTimeout); }
void DisplayPopupDialogImage(Bitmap img, int imgHeight, int imgWidth, int nSecTimeout) { if (this.WindowState == FormWindowState.Minimized || m_bIsMainFormActive == false) { return; } FloatingImage m_floatingImageDlg = new FloatingImage(); Rectangle rect = this.Bounds; Point px = new Point(rect.Right, rect.Top); Point screenLocation = PointToScreen(px); m_floatingImageDlg.SetImage(img); m_floatingImageDlg.SetImgSize(imgHeight, imgWidth); m_floatingImageDlg.SetImgLocation(screenLocation.X - (imgWidth + (imgWidth / 2)), screenLocation.Y); m_floatingImageDlg.Show(nSecTimeout); }