Click here to Skip to main content
15,891,409 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# and Managed DirectX Invalid Rectangle Pin
James T. Johnson3-Jun-03 2:00
James T. Johnson3-Jun-03 2:00 
GeneralRe: C# and Managed DirectX Invalid Rectangle Pin
EvilDingo3-Jun-03 4:27
EvilDingo3-Jun-03 4:27 
GeneralSelected row from a ListView Pin
quicksilver02022-Jun-03 1:03
quicksilver02022-Jun-03 1:03 
Generalexisting code from c++ Pin
stonee741-Jun-03 22:26
stonee741-Jun-03 22:26 
GeneralGif compression using Save method on bitmap class Pin
christiantoivola1-Jun-03 22:08
christiantoivola1-Jun-03 22:08 
GeneralRe: Gif compression using Save method on bitmap class Pin
Richard Deeming1-Jun-03 23:33
mveRichard Deeming1-Jun-03 23:33 
Generalshow tooltip Pin
grv5751-Jun-03 20:16
grv5751-Jun-03 20:16 
GeneralRe: show tooltip Pin
Singh, Manish2-Jun-03 20:44
Singh, Manish2-Jun-03 20:44 
GeneralSystem.NullReferenceException in RichTextBox while dynamically adding text Pin
CNU1-Jun-03 19:58
CNU1-Jun-03 19:58 
GeneralCreate a remort object in C# Pin
Gaurika Wijeratne1-Jun-03 17:54
Gaurika Wijeratne1-Jun-03 17:54 
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 
HI. I'm just learning c# and need a little help with events.

(the following scenario is just an example...hopefully to simplify)

Lets say I have a custom control called Cars which has three states: drive, park and reverse

Now let's say i have a racetrack control that can contain any number of Cars controls, but does not NEED to know anything about those Cars, like their state or even how many of them there are.

Lets add a button to the racetrack control called Go.

When the user clicks Go, I would like an event to be fired that all the Cars can hear and process accordingly. (The ones in park ignore it, those in reverse start moving backwards, those in drive move forward...)

I would also like the Cars controls to be able to fire their own custom events (like HornHonked...) that can be heard by anything, like other Cars, the racetrack, or other controls (pedestrians, pigeons...).

I don't know how events work in C# .NET, so I'm not sure where to start. I came across Instrumentation, but don't know if this is appropriate for such a task. I don't know if I can use existing events somehow, or inherit from events or just create my own. I don't know how you tell parents and children what to listen for and how to make sure they hear it.

I thought there might be a better solution than:
User hits the Go button. In Go_OnClick(), the racetrack iterates through a collection of Cars controls (updated as Cars are added to, removed from the racetrack) and calls a Cars.Go() method.

Like I said, I'm just learning C# from scratch, so I'm not aware of all the features. Sorry about the dumb Cars stuff, it just seemed like an easy example.

Thnaks,
Tym!

GeneralSome Progress, Sound good? Pin
Tym!1-Jun-03 13:23
Tym!1-Jun-03 13:23 
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 

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.