0
我正在研究一個從Form類繼承的類庫,然後在Gui應用程序中顯示這個表單。現在我需要將類庫改爲UserControl
。在WinForm中顯示UserControl
如何在另一個項目中的表單內顯示它?在此先感謝您的建議。
IFaceForm是InterfaceLibrary中的usercontrol。
using InterfaceLibrary;
namespace MxlInterface
{
public partial class IFaceConn : Form
{
iFaceForm Interface = new iFaceForm();
//size of the parent form is 881,514
//use these variables to change the position of the "Interface Form"
int xlocation = 0;
int ylocation = 0;
public IFaceConn()
{
InitializeComponent();
//Interface.StartPosition = FormStartPosition.Manual;
Interface.Location = new Point(xlocation, ylocation);
//Interface.MdiParent = this;
Interface.Show();
}
}
}
請發佈任何您可能擁有的相關代碼。 – Brian 2013-02-13 18:46:37
this.Controls.Add(Interface); – 2013-02-13 19:05:31
感謝所有,比我想象的更容易:) – Art 2013-02-13 19:21:05