重复的表格没有完美运行 [英] Duplicated Form is Not Running Perfectly

查看:70
本文介绍了重复的表格没有完美运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在2008年开发基于窗口的项目。我发布了mdi表单的表单。我正在开发INventory系统项目。在mdiform里面运行的所有形式。我的客户要求以销售形式提出一些要求。这是一台机器中的多个销售表单。

ex:第一位客户 - > Sysytem admin 5型产品 - >客户需要另外购买一些物品。所以这里系统管理员需要打开另一个销售表单等。



i尝试此代码



Hi i'm developing window based project in vs 2008. i've issues in forms with mdi forms. i'm developing INventory system project.In all forms running inside the mdiform. my client requesting some requirment in sales form. that's multiple sales forms at a time in a single machine.
ex: 1st customer --> Sysytem admin type 5 products--> customer need to buy another some items. so here the System admin need to Open another Sales form etc.

i tried this Code

Dim frmSale = New frmSales
        frmSale.WindowState = FormWindowState.Normal
        frmSale.FormBorderStyle = FormBorderStyle.FixedSingle
       frmSales.Size = New Size(600, 500)
       frmSale.TopLevel = False
       frmSale.Parent = Me.pnlCon
       frmSale.Show()
       frmSale.BringToFront()





但它的工作原理。但在表格中我正在使用gridview。我无法将数据推送到当前动态格式gridview和其他字段。

其他关键如何将现有表单创建为多个表单(多个实例)。如何将值设置为新创建的实例。



帮我解决这个问题



But its working. but inside the form i'm using gridview. i could not push the datas to Current dynamic form gridview and other fields.
Otherwords how to create existing form as multiple forms(multiple instances). how to set the values to newly created instances.

help me too fix this issue

推荐答案

/////////你有在c#中标记了问题并在VB中提供了代码块,下面的代码是c#。如果你是
$ b $ // //////////使用VB根据你的要求改变代码以下



/////////在父母中创建一个全局数据表并设置属性

/////////u have tagged the question in c# and provided code block in VB ,below code is c#.if u r
//////////using VB change below code as per ur requirement

/////////create a global data table and set property in the parent
DataTable _childGridDt = new DataTable();



////////////为父母数据表设置属性


////////////set property for the datatable in parent

public DataTable ChildGridDt
{
    get { return _childGridDt ; }

}





/////////////在你的子表单中,即'frmSales'创建一个全局数据表并设置属性



/////////////in ur child form ie 'frmSales' create a global data table and set property

DataTable _childGridDt = new DataTable();

      public DataTable ChildGridDt
      {
          get { return _childGridDt ; }
          set { _childGridDt = value; }
      }





//////////////当你打电话使用对象frmSale的表单传递数据表值



//////////////when u call the form using object frmSale pass the data table value

Dim frmSale = New frmSales



/////将值传递给对象frmSale


/////passing value to the object frmSale

frmSale.ChildGridDt='your datatable from database';
 frmSale.WindowState = FormWindowState.Normal
frmSale.FormBorderStyle = FormBorderStyle.FixedSingle
frmSales.Size = New Size(600, 500)
 frmSale.TopLevel = False
 frmSale.Parent = Me.pnlCon
 frmSale.Show()
frmSale.BringToFront()





/////////////在'frmSales'的加载部分,子窗体绑定网格与dat值得支付

//////// gridInfrmSales,子格形网格



/////////////in the load section of 'frmSales', child form bind grid with datatable value
////////gridInfrmSales,grid in child form

gridInfrmSales.Datasource=_childGridDt;





gudluck; - )



gudluck ;-)


这篇关于重复的表格没有完美运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆