Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to VB.Net. I have two user control(ucMaster and ucDetail) and want to access a function of ucMaster(ie GenerateMember()) from ucDetails. what is the code snippet for this i used the following but stuck with error

ucDetail.vb
VB
objucmaster as new ucMaster
objMaster.GenerateMember()
Posted
Updated 10-Aug-10 21:01pm
v2
Comments
CPallini 11-Aug-10 3:01am    
Please complete your request with detailed error info (posting just the error message would do the trick).
Sandeep Mewara 11-Aug-10 3:47am    
What error? Further, are they Master-child kind of controls or two independent user controls?

1 solution

If you created the two user controls, then in the class definition you need to specify the GenerateMember as public e.g.

<pre>
Public Sub GenerateMember()
''Your code
End Sub
</pre>

If you inherit therefore making details a child of master, you should declare the sub as protected.

<pre>
Protected Sub GenerateMember()
''Your code
End Sub
</pre>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900