Thanh Le
unread,Mar 6, 2012, 8:42:30 PM3/6/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Hỏi đáp
Chào cả nhà, cho mình hỏi tý
ví dụ mình đã tạo 1 project test, chạy ok, mình biên dịch nó ra file
dll test.dll
mình tạo 1 cái project khác add dll vừa tạo vào
cách gọi như thế này thì ổn
test.Form1 frm = new test.Form1();
frm.show();
nhưng vấn đề ở đây là mình muốn lưu tên test.dll vào database rồi gọi
lại để tạo 1 cái menu chương trình động, chưa biết phải làm sao mong
các anh các chị các em, các chú các bác giúp đỡ hihi
--------------------------------------------------------------------------------
private void Call_Form1(string fname)
{
string sFormName = fname;
Type oFormType = Type.GetType("QLBH.Presentation." +
sFormName);
ConstructorInfo oConstructorInfo =
oFormType.GetConstructor(System.Type.EmptyTypes);
Form oForm = (Form)oConstructorInfo.Invoke(null);
DataTable dt = new DataTable();
dt = APCoreDal.read("select add_tappage from syssubmenu
where ten_form='"+fname+"'");
if (dt.Rows.Count > 0)
{
if (dt.Rows[0]["add_tappage"].ToString() == "False")
{
oForm.TopMost = true;
oForm.StartPosition =
FormStartPosition.CenterScreen;
oForm.Show();
}
else
{
oForm.TopLevel = false;
oForm.Dock = DockStyle.Fill;
oForm.FormBorderStyle = FormBorderStyle.None;
DevExpress.XtraTab.XtraTabPage page = new
DevExpress.XtraTab.XtraTabPage();
page.Controls.Add(oForm);
page.Text = fname;
page.ShowCloseButton =
DevExpress.Utils.DefaultBoolean.True;
xtraTabmain.TabPages.Add(page);
xtraTabmain.SelectedTabPageIndex =
xtraTabmain.TabPages.Count;
oForm.Show();
}
}
}
---> đây là cách gọi các form có sẵn trong project có tên form trong
database
mình muốn thay các form đó bằng các form đã biên dịch thành dll thì
làm thế nào hic hic
mong được sự giúp đở của mọi người
Xin cảm ơn và hậu tạ hehe