您可以通过frm_DailySaleSummary的构造函数将 uc_Daily_sale 中的控件值带到frm_DailySaleSummary 这是我的代码,您可以参考。 uc_Daily_sale
Private Sub DataGridView2_CellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView2.CellDoubleClick
Dim frm As New frm_DailySaleSummary(DateTimePicker1.Value, DateTimePicker2.Value, txt_dsr.Text)
frm.Show()
End Sub
frm_DailySaleSummary
Dim DTPicker1 As Date
Dim DTPicker2 As Date
Dim txt_dsr As String
Public Sub New(DTPicker1 As Date, DTPicker2 As Date, txt_dsr As String)
InitializeComponent()
DTPicker1 = DTPicker1
DTPicker2 = DTPicker2
txt_dsr = txt_dsr
End Sub
我对我的代码进行了一些修改。 以下代码可以解决您的问题。
Public Sub New(DTPicker1 As Date, DTPicker2 As Date, txt_dsr As String)
' This call is required by the designer.
InitializeComponent()
Me.DTPicker1 = DTPicker1
ME.DTPicker2 = DTPicker2
Me.txt_dsr = txt_dsr
' Add any initialization after the InitializeComponent() call.
End Sub
如果答案是正确的,请点击“接受答案”并点赞。 如果您对此答案还有其他疑问,请点击“评论”。
注意:如果您想接收相关电子邮件,请按照我们的文档中的步骤启用电子邮件通知 此线程的通知。