Click here to Skip to main content
15,889,861 members
Home / Discussions / C#
   

C#

 
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
mve#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 
QuestionHow to invoke multiple webmethods at a once? Pin
venkat.st19-Dec-08 3:32
venkat.st19-Dec-08 3:32 
AnswerRe: How to invoke multiple webmethods at a once? Pin
Le centriste19-Dec-08 4:56
Le centriste19-Dec-08 4:56 
QuestionDirectory Services Pin
Jacob D Dixon19-Dec-08 3:30
Jacob D Dixon19-Dec-08 3:30 
QuestionFtp Transfer Server to Server Pin
New78019-Dec-08 3:12
New78019-Dec-08 3:12 
AnswerRe: Ftp Transfer Server to Server Pin
Rutvik Dave19-Dec-08 3:28
professionalRutvik Dave19-Dec-08 3:28 
GeneralRe: Ftp Transfer Server to Server Pin
New78019-Dec-08 4:21
New78019-Dec-08 4:21 
GeneralRe: Ftp Transfer Server to Server Pin
Rutvik Dave19-Dec-08 5:25
professionalRutvik Dave19-Dec-08 5:25 
GeneralRe: Ftp Transfer Server to Server Pin
New78025-Dec-08 23:17
New78025-Dec-08 23:17 
Questionhow to convert c++ to C# ? Pin
lockepeak19-Dec-08 2:39
lockepeak19-Dec-08 2:39 
AnswerRe: how to convert c++ to C# ? Pin
DaveyM6919-Dec-08 2:46
professionalDaveyM6919-Dec-08 2:46 
AnswerRe: how to convert c++ to C# ? Pin
Dave Doknjas19-Dec-08 12:44
Dave Doknjas19-Dec-08 12:44 
QuestionLoop through and process every php code. Pin
jafingi19-Dec-08 1:13
jafingi19-Dec-08 1:13 
AnswerRe: Loop through and process every php code. Pin
Jens Meyer19-Dec-08 1:35
Jens Meyer19-Dec-08 1:35 
GeneralRe: Loop through and process every php code. [modified] Pin
jafingi19-Dec-08 1:51
jafingi19-Dec-08 1:51 
GeneralRe: Loop through and process every php code. Pin
Gideon Engelberth19-Dec-08 3:18
Gideon Engelberth19-Dec-08 3:18 

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.