User control

  • Thread starter Thread starter ucasesoftware
  • Start date Start date
U

ucasesoftware

Hi
I have a form and a user control

In my usercontrol i have a datagrid who need a customerGuid to display
customer information

When i load my form i need to tell the userControl that the guid of the
custormer is customerGuid

I don't have success to do this :(

Someone could help ?
 
ucasesoftware said:
I have a form and a user control

In my usercontrol i have a datagrid who need a customerGuid to display
customer information

When i load my form i need to tell the userControl that the guid of the
custormer is customerGuid

Add a property to the usercontrol which accepts the customer's GUID. Then
set this property to the desired GUID. Inside the property's implementation
you can assign the GUID to the datagrid control.
 
i did that :
in the usercontrol :

Private m_customerGuid As Guid
Public Property customerGuid () As Guid
Get
Return m_customerGuid
End Get
Set(ByVal Value As Guid)
m_customerGuid = Value
End Set
End Property

Public Sub New(ByVal customerGuid As Guid)
MyBase.New()

'Cet appel est requis par le Concepteur Windows Form.
InitializeComponent()

'Ajoutez une initialisation quelconque après l'appel
InitializeComponent()
m_customerGuid = customerGuid

End Sub


But when i drag and drop the usercontrol in the form i have an error ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top