Posts Tagged ‘窗口’
SBO 调用模态与非模态窗体
星期五, 一月 25, 2008 18:28 No CommentsSBO显示非模态窗体
“itemEvent”
viewWinForm vWForm =new ViewWinForm();
Thread T=new Thread(new ThreadStart(vWForm.view));
t.SetApartmentState(ApartmentState.STA);
t.start();
CLASS ViewWinForm
{
Private bool run;
Form oForm;
public ViewWinForm()
{
//构造函数
oForm=new Form();
oForm.FormClosed+=new ormClosedEventHandler(form_FormClosed);
}
public void view()
{
run = true;
form.Show();
while (run)
{
Application.DoEvents();
Thread.Sleep(1);
}
}
void form_FormClosed(object sender, FormClosedEventArgs e)
{
run = false;
}
}
SBO中显示模态窗体(如:对话框)
摘自https://www.sdn.sap.com/irj/sdn/thread?threadID=45710&tstart=0
After searching the forums for a way to reliably open an open file dialog I didn’t really find any examples showing what I needed. Anyway, here’s what I came up with.
There [...]