簡體   English   中英

將窗口對話框嵌入窗口窗體

[英]Embeded window dialog into Window Form

我正在將Straus7 API與C#結合使用,並通過API使用。 我可以打開模型的窗口對話框,但它像彈出對話框一樣打開。 如何將Windows對話框嵌入到C#表單中? 我不需要彈出對話框,如何實現?

圖像由於@Mihail,我寫這篇文章的代碼和它的工作。 我的最終代碼是:

        /////////////////////////////////////////////////
        St7.St7CreateModelWindow(1);
        St7.St7ShowModelWindow(1);
        St7.St7PositionModelWindow(1, 0, 0, 640, 480);
        St7.St7ShowWindowTopPanel(1);
        /////////////////////////////////////////////////

        int temp = 0;
        St7.St7GetModelWindowHandle(1, ref temp);
        IntPtr hostHandle =  new IntPtr(temp);
        IntPtr guestHandle = new WindowInteropHelper(this).Handle; 

        //SetParent(guestHandle, hostHandle);
        SetParent(hostHandle, guestHandle);

現在只需要進行一些調整。

我認為您可以使用以下代碼:

    this.IsMdiContainer = true;
    Form Form = new Form();
    Form.MdiParent = this;
    Form.Show();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM