Click here to Skip to main content
15,909,242 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCalling parent form/container from user control Pin
Valkiri11-Dec-08 3:04
Valkiri11-Dec-08 3:04 
AnswerRe: Calling parent form/container from user control Pin
Ashfield11-Dec-08 3:18
Ashfield11-Dec-08 3:18 
GeneralRe: Calling parent form/container from user control Pin
Valkiri11-Dec-08 11:29
Valkiri11-Dec-08 11:29 
AnswerRe: Calling parent form/container from user control Pin
Tom Deketelaere11-Dec-08 4:15
professionalTom Deketelaere11-Dec-08 4:15 
GeneralRe: Calling parent form/container from user control Pin
Valkiri11-Dec-08 11:41
Valkiri11-Dec-08 11:41 
GeneralRe: Calling parent form/container from user control Pin
Tom Deketelaere11-Dec-08 21:12
professionalTom Deketelaere11-Dec-08 21:12 
GeneralRe: Calling parent form/container from user control Pin
Valkiri11-Dec-08 23:17
Valkiri11-Dec-08 23:17 
AnswerRe: Calling parent form/container from user control Pin
Dave Kreskowiak11-Dec-08 4:40
mveDave Kreskowiak11-Dec-08 4:40 
Valkiri wrote:
How do I reference a method in the usercontrols parent container


You should never be doing this. A control should not care about, nor try to explicitly manipulate, it's parent container.


Valkiri wrote:
Somewhat obviously at design time these classes do not know their eventual parent.


The same is true for runtime. Your controls should not know anything about their parent.


Valkiri wrote:
The buttons click event would call the forms SaveAll method.


No, it shouldn't. Your control shouldn't even have a button like this. This button should be on the parent form, not your control. Your control only needs to expose, by public properties or events and argument, the values and settings under its control. It's up to the parent form to decide what to do with those values.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008




GeneralRe: Calling parent form/container from user control Pin
Valkiri11-Dec-08 12:11
Valkiri11-Dec-08 12:11 
GeneralRe: Calling parent form/container from user control Pin
Dave Kreskowiak11-Dec-08 12:44
mveDave Kreskowiak11-Dec-08 12:44 
GeneralRe: Calling parent form/container from user control Pin
Valkiri11-Dec-08 16:11
Valkiri11-Dec-08 16:11 
GeneralRe: Calling parent form/container from user control Pin
Dave Kreskowiak11-Dec-08 21:23
mveDave Kreskowiak11-Dec-08 21:23 
GeneralRe: Calling parent form/container from user control Pin
Valkiri11-Dec-08 22:21
Valkiri11-Dec-08 22:21 
QuestionUser defined type not defined - Error Pin
samsonx11-Dec-08 0:26
samsonx11-Dec-08 0:26 
AnswerRe: User defined type not defined - Error Pin
Ashfield11-Dec-08 1:20
Ashfield11-Dec-08 1:20 
AnswerRe: User defined type not defined - Error Pin
Nanda_MR11-Dec-08 21:49
Nanda_MR11-Dec-08 21:49 
QuestionSetting the DataTable object to Nothing Pin
Coding12345610-Dec-08 19:17
Coding12345610-Dec-08 19:17 
AnswerRe: Setting the DataTable object to Nothing Pin
Christian Graus10-Dec-08 21:15
protectorChristian Graus10-Dec-08 21:15 
GeneralRe: Setting the DataTable object to Nothing Pin
Coding12345611-Dec-08 10:54
Coding12345611-Dec-08 10:54 
GeneralRe: Setting the DataTable object to Nothing Pin
Luc Pattyn11-Dec-08 1:32
sitebuilderLuc Pattyn11-Dec-08 1:32 
AnswerRe: Setting the DataTable object to Nothing [modified] Pin
Dave Kreskowiak11-Dec-08 4:36
mveDave Kreskowiak11-Dec-08 4:36 
GeneralRe: Setting the DataTable object to Nothing Pin
Luc Pattyn11-Dec-08 4:48
sitebuilderLuc Pattyn11-Dec-08 4:48 
GeneralRe: Setting the DataTable object to Nothing Pin
Dave Kreskowiak11-Dec-08 4:55
mveDave Kreskowiak11-Dec-08 4:55 
GeneralRe: Setting the DataTable object to Nothing Pin
Coding12345611-Dec-08 11:04
Coding12345611-Dec-08 11:04 
GeneralRe: Setting the DataTable object to Nothing Pin
Dave Kreskowiak11-Dec-08 12:38
mveDave Kreskowiak11-Dec-08 12:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.