williambirkin

恭喜发财!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

目的:
实现在主窗体中调用子窗体showdialog方法显示主窗体,并通过该方法传递自定义参数给子窗体。

子窗体
主要是传递父窗体到子窗体中。然后再调用this.ShowDialog(parent)就可。
代码如下:

public void ShowDialog(string customerID, IWin32Window parent, int Mode)
{
      
//
      
//code
      
//..

      
// Show the dialog.
      this.ShowDialog(parent);
}

父窗体
代码如下:
// Show sub form
SubForm sf = new SubForm();
sf.ShowDialog(customerID, 
this,1); 

posted on 2006-12-11 10:04  williambirkin  阅读(1523)  评论(0编辑  收藏  举报