ต้องการส่งค่าจาก datagrid ใน windows form ไป textbox ใน user control Code (VB.NET)
Public Class member
Dim invoice As invoice 'invoice คือ usercontrol
Private Sub gridviewshow_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles gridviewshow.KeyDown
If e.KeyCode = Keys.Enter Then
invoice.txtMem.Text = (gridviewshow.CurrentRow.Cells("mem_id").Value)
invoice.txtMemName.Text = (gridviewshow.CurrentRow.Cells("mem_name").Value)
invoice.txtMemSername.Text = (gridviewshow.CurrentRow.Cells("mem_sername").Value)
invoice.txtHMem.Text = (gridviewshow.CurrentRow.Cells("mem_Hid").Value)
invoice.txtHMemName.Text = (gridviewshow.CurrentRow.Cells("mem_Hname").Value)
invoice.txtHMemSername.Text = (gridviewshow.CurrentRow.Cells("mem_Hsername").Value)
invoice.txtAddress.Text = (gridviewshow.CurrentRow.Cells("mem_address").Value)
Me.Close()
invoice.txtProID.Focus()
End If
End Sub
End Class
มันขึ้น Error ที่ " invoice.txtMem.Text = (gridviewshow.CurrentRow.Cells("mem_id").Value)" ว่า Object reference not set to an instance of an object.
Tag : .NET, Ms Access, Crystal Report, Win (Windows App), VS 2008 (.NET 3.x), Windows
มีครับ จาก user control ไป windows form ไม้มีปัญหาแต่นะนำ window form ไป user control หรือ user control ไป user control มัน error user control มันระบค่าจาก form อื่นยังไงครับ