Click here to Skip to main content
15,911,315 members
Home / Discussions / C#
   

C#

 
GeneralRe: A form's minimum height Pin
Andrew Paul19-Dec-08 10:27
Andrew Paul19-Dec-08 10:27 
GeneralRe: A form's minimum height Pin
Dave Kreskowiak19-Dec-08 15:48
mveDave Kreskowiak19-Dec-08 15:48 
GeneralRe: A form's minimum height Pin
Andrew Paul19-Dec-08 15:53
Andrew Paul19-Dec-08 15:53 
AnswerRe: A form's minimum height Pin
Luc Pattyn19-Dec-08 10:17
sitebuilderLuc Pattyn19-Dec-08 10:17 
GeneralRe: A form's minimum height Pin
Andrew Paul19-Dec-08 10:25
Andrew Paul19-Dec-08 10:25 
GeneralRe: A form's minimum height Pin
Luc Pattyn19-Dec-08 10:57
sitebuilderLuc Pattyn19-Dec-08 10:57 
Questionproblems with myclass Pin
mirko8619-Dec-08 8:39
mirko8619-Dec-08 8:39 
AnswerRe: problems with myclass Pin
Wes Aday19-Dec-08 8:49
professionalWes Aday19-Dec-08 8:49 
GeneralRe: problems with myclass Pin
mirko8619-Dec-08 8:51
mirko8619-Dec-08 8:51 
AnswerRe: problems with myclass Pin
Adam Maras19-Dec-08 8:51
Adam Maras19-Dec-08 8:51 
GeneralRe: problems with myclass Pin
mirko8619-Dec-08 8:58
mirko8619-Dec-08 8:58 
GeneralRe: problems with myclass Pin
#realJSOP19-Dec-08 9:38
professional#realJSOP19-Dec-08 9:38 
GeneralRe: problems with myclass [modified] Pin
mirko8619-Dec-08 11:24
mirko8619-Dec-08 11:24 
QuestionExecute code at exact time Pin
tcombs0719-Dec-08 8:02
tcombs0719-Dec-08 8:02 
AnswerRe: Execute code at exact time Pin
Giorgi Dalakishvili19-Dec-08 8:11
mentorGiorgi Dalakishvili19-Dec-08 8:11 
AnswerRe: Execute code at exact time Pin
Blue_Boy19-Dec-08 8:14
Blue_Boy19-Dec-08 8:14 
GeneralRe: Execute code at exact time Pin
#realJSOP19-Dec-08 10:18
professional#realJSOP19-Dec-08 10:18 
GeneralRe: Execute code at exact time Pin
Blue_Boy19-Dec-08 10:22
Blue_Boy19-Dec-08 10:22 
QuestionIs there a bug in the treeView.Nodes.Find method?? Pin
Rafone19-Dec-08 6:27
Rafone19-Dec-08 6:27 
AnswerRe: Is there a bug in the treeView.Nodes.Find method?? Pin
PIEBALDconsult19-Dec-08 7:15
mvePIEBALDconsult19-Dec-08 7:15 
GeneralRe: Is there a bug in the treeView.Nodes.Find method?? Pin
Rafone19-Dec-08 7:32
Rafone19-Dec-08 7:32 
QuestionDeploying an application written in C# 2005 Special Edition Pin
AngusOAP19-Dec-08 6:15
AngusOAP19-Dec-08 6:15 
QuestionHook Child events into Parent UserControl Pin
mmuttmax19-Dec-08 5:33
mmuttmax19-Dec-08 5:33 
Hi all, I was thinking there had to be an easier way to do this.

I have a UserControl which contains a PictureBox and Label as children. I don't want to make the consumer have to hook the events or even expose the child controls.

So how do you let the user add the event handler to the custom control and have it propagate down through to the children.

I've done this which works but may give more explanation as to what I'm trying to do.
Basically it's just assigning the event within the InitializeComponent().


<br />
                private void SetPictureEventsToParent()<br />
		{<br />
			picture.MouseClick += new System.Windows.Forms.MouseEventHandler(picture_MouseClick);<br />
		}<br />
<br />
		void picture_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)<br />
		{<br />
			this.OnMouseClick(e);<br />
		}<br />
<br />
		private void SetLabelEventsToParent()<br />
		{<br />
			label.MouseClick += new System.Windows.Forms.MouseEventHandler(label_MouseClick);<br />
		}<br />
<br />
		void label_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)<br />
		{<br />
			this.OnMouseClick(e);<br />
		}<br />


The problem is the Label and PictureBox cover the parent and so the parent never receives the event unless I do this.

Thanx
Questionimport csv. Read not a problem, just cannot display the columns Pin
arenaldo19-Dec-08 4:51
arenaldo19-Dec-08 4:51 
AnswerRe: import csv. Read not a problem, just cannot display the columns Pin
Le centriste19-Dec-08 4:55
Le centriste19-Dec-08 4:55 

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.