Click here to Skip to main content
15,920,503 members
Home / Discussions / C#
   

C#

 
GeneralRe: Create a remort object in C# Pin
Kannan Kalyanaraman1-Jun-03 22:17
Kannan Kalyanaraman1-Jun-03 22:17 
GeneralRe: Create a remort object in C# Pin
Gaurika Wijeratne1-Jun-03 22:39
Gaurika Wijeratne1-Jun-03 22:39 
Generalurgent help needed, event handler Pin
mtrx1-Jun-03 17:35
mtrx1-Jun-03 17:35 
GeneralRe: urgent help needed, event handler Pin
Ray Cassick1-Jun-03 17:55
Ray Cassick1-Jun-03 17:55 
GeneralRe: urgent help needed, event handler Pin
mtrx2-Jun-03 3:41
mtrx2-Jun-03 3:41 
GeneralRe: urgent help needed, event handler Pin
shaunAustin3-Jun-03 1:25
shaunAustin3-Jun-03 1:25 
GeneralCustom Control Events Pin
Tym!1-Jun-03 12:05
Tym!1-Jun-03 12:05 
GeneralSome Progress, Sound good? Pin
Tym!1-Jun-03 13:23
Tym!1-Jun-03 13:23 
so typical, as soon as i posted, i made some headway in my search. I think I have some options:

- have my custom child controls subscribe to the OnClick event of the Go button on the parent Racetrack control. So, when the onclick event is fired, all Cars controls who subscribe will receive the mesasge. This, however, ties the parent and child controls together, ie, I couldn't plop the Cars controls into, say, a driveway control, without, at a minimum, having the driveway control send an identical OnClick event...

- have the parent control publish a custom event that the child controls can subscribe to, and fire this event when the go button is clicked, or as necessary. this has the same problem as above, a new container/parent control must publish the same event

- this would be wonderful, but not sure if it's legal. in the namespace of the Cars control, but not in the Cars class itself, publish a custom event:

<br />
public event EventHandler GoEvent;<br />


then, in the parent control, fire the event when necessary, as in the OnClick event of the Go button:

<br />
if( GoEvent != null ) //if we have subscribers<br>      GoEvent( this, new EventArgs() ) //fire the event<br />


and, in the Cars control Class, subscribe to the event:

<br />
CarsNamespace.GoEvent += new EventHandler(OnGoEvent);<br />


Then when a Cars control receives a GoEvent, it will call OnGoEvent().

So, that is what I'd like, but it seems like just throwing it in the namespace like that wouldn't be enough, or is it?
I feel like I am close, but just barely missing something. Like, would I need to declare the GoEvent in the parent??

ok, sorry if you read this far and want the last 3 minutes of your life back... but I just found a little more out and it seems that the namespace thing is a bust, but the second method looks like the way it really works. And my "fix" for the problem of tying the parent to the child would apparently be to create a kind of CarsManager class that handles adding and removing cars, and publishes the events and the event would be triggered by a CarsManager method call. Sorry to make you suffer through my learning process. but, if i'm still missing something or if i made some bad choices, assumptions, I'll always listen to anything...

Thanks,
tym!

PS thanks to moredip who posted this stuff here.
QuestionGDI+, How to stop antialias? Pin
FruitBatInShades31-May-03 23:51
FruitBatInShades31-May-03 23:51 
AnswerRe: GDI+, How to stop antialias? Pin
leppie1-Jun-03 0:07
leppie1-Jun-03 0:07 
GeneralRe: GDI+, How to stop antialias? Pin
FruitBatInShades1-Jun-03 0:44
FruitBatInShades1-Jun-03 0:44 
QuestionHow to extend System.Int32? Pin
ralfoide31-May-03 15:58
ralfoide31-May-03 15:58 
AnswerRe: How to extend System.Int32? Pin
Eric Gunnerson (msft)31-May-03 16:35
Eric Gunnerson (msft)31-May-03 16:35 
GeneralRe: How to extend System.Int32? Pin
ralfoide1-Jun-03 17:13
ralfoide1-Jun-03 17:13 
GeneralRe: How to extend System.Int32? Pin
ralfoide1-Jun-03 17:42
ralfoide1-Jun-03 17:42 
GeneralRe: How to extend System.Int32? Pin
leppie2-Jun-03 8:00
leppie2-Jun-03 8:00 
GeneralRe: How to extend System.Int32? Pin
Eric Gunnerson (msft)3-Jun-03 9:47
Eric Gunnerson (msft)3-Jun-03 9:47 
AnswerRe: How to extend System.Int32? Pin
leppie1-Jun-03 0:39
leppie1-Jun-03 0:39 
GeneralRe: How to extend System.Int32? Pin
David Stone2-Jun-03 9:50
sitebuilderDavid Stone2-Jun-03 9:50 
GeneralSetting Form's size problems Pin
Acidis31-May-03 11:38
Acidis31-May-03 11:38 
GeneralRe: Setting Form's size problems Pin
J. Dunlap31-May-03 11:42
J. Dunlap31-May-03 11:42 
GeneralRe: Setting Form's size problems Pin
Acidis31-May-03 11:47
Acidis31-May-03 11:47 
GeneralRe: Setting Form's size problems Pin
James T. Johnson31-May-03 18:06
James T. Johnson31-May-03 18:06 
GeneralRe: Setting Form's size problems Pin
Acidis31-May-03 19:36
Acidis31-May-03 19:36 
GeneralRe: Setting Form's size problems Pin
James T. Johnson31-May-03 19:59
James T. Johnson31-May-03 19:59 

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.