开发者

How can I make a WinForms Form work as a DockableContent in AvalonDock?

开发者 https://www.devze.com 2023-01-07 06:05 出处:网络
I am able to use WinForms controls, but not an entire form: var foo = new DockableContent(); foo.Title = \"Foo\";

I am able to use WinForms controls, but not an entire form:

        var foo = new DockableContent();
        foo.Title = "Foo";
        foo.Name = "FooName";


        var c = new WindowsAppFramework.RenderTargetUserControl();
        c.Dock = System.Windows.Forms.DockStyle.Fill;
        c.AutomaticUpdateFPS = 60;

        var host = new System.Windows.Forms.Integration.WindowsFormsHost();
        host.Child = c;

        foo.Content = host;
        foo.ShowAsDocument(dockManager);
        foo.Focus();

Is it开发者_如何学JAVA possible to use an entire Form? I want to make use of existing Forms in the Application.


You can turn a form into a child control:

  var frm = new Form1();
  frm.TopLevel = false;
  frm.Visible = true;
  frm.FormBorderStyle = FormBorderStyle.None;

Which essentially turns it into a UserControl.

0

精彩评论

暂无评论...
验证码 换一张
取 消