0

I'm using The Viewer's reporting feature in Winform, Which has the ability to export pdfs, but before clicking on the export to pop up the save window, a "exporting" window will appear, I want to hide this window but I can't solve it after trying some methods, who can help me? Click on the screenshot of the question

I tried something but couldn't solve it:

foreach(Form item in Applictaion.OpenForms){
    //Hide this window 
    if(item.Title == "正在导出")
        item.Hide();  
}

I also tried this:

if (this.reportViewer1.Controls.Find("exportDialog", true)[0] is Form form)
    {
        //"exportDialog" may be the Name property value I tried to find in the source code, but it was prompted that "index out of range"
        form.Hide();
    }
  • To identify a Dialog when it's opened and close it if a condition is met (e.g., the text of it's Caption): [How to get the text of a MessageBox when it has an icon?](https://stackoverflow.com/q/55014473/7444103) (the title of question doesn't explain much, but that's what it's about). – Jimi Sep 06 '21 at 01:16
  • I found the Exporting window handle, but I don't know how to hide it. – BlueSkyCaps Sep 06 '21 at 03:38
  • @BlueSkyCaps if You need hide window check this [c# ShowWindow hWnd, 0 not hiding window](https://stackoverflow.com/questions/24557671/c-sharp-showwindow-hwnd-0-not-hiding-window), documentation - [WM_SHOWWINDOW message](https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-showwindow) – Genusatplay Sep 10 '21 at 17:41

0 Answers0