Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hai Sir,

I am trying to pass data from user control to parent Form in windows application...passing data from windows form to user control is working fine...but user control to form is not working
here am providing some code related my task :

form to user control :
i created property in user control like
VB
Private ChkSign As Boolean = False
Public Property CheckPhoto() As Boolean
       Get
           Return ChkPhoto
       End Get
       Set(ByVal value As Boolean)
           ChkPhoto = value
       End Set
   End Property


I am passing boolean value from windows form...if value is true am processing code functionality
on windows form its fine for me..but ofter click on button am passing value of user control text box text value to main form..it is working when i set this form is a start up page..but
it is not working when i come to this form from another form ...please give some solution for this..
Posted
Updated 22-Sep-13 2:19am
v3

You shouldn't try to pass data up - the form should ask it's controls for the data via properties as in your example, but the control should "tell" the form that data is available via an event.

Have a look at this: Transferring information between two forms, Part 2: Child to Parent[^] - it's in C# but the idea is exactly the same.
 
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