Click here to Skip to main content
15,867,453 members
Home / Discussions / C#
   

C#

 
AnswerRe: ASP.NET Project Files Pin
Richard MacCutchan12-Feb-14 4:42
mveRichard MacCutchan12-Feb-14 4:42 
QuestionThe file version maintain utility Pin
sahani from india12-Feb-14 1:56
sahani from india12-Feb-14 1:56 
AnswerRe: The file version maintain utility Pin
Pete O'Hanlon12-Feb-14 2:16
subeditorPete O'Hanlon12-Feb-14 2:16 
GeneralRe: The file version maintain utility Pin
OriginalGriff14-Feb-14 22:27
mveOriginalGriff14-Feb-14 22:27 
QuestionHelp needed XNA and Window Forms Pin
larsp77712-Feb-14 0:57
larsp77712-Feb-14 0:57 
AnswerRe: Help needed XNA and Window Forms Pin
DaveyM6912-Feb-14 1:09
professionalDaveyM6912-Feb-14 1:09 
GeneralRe: Help needed XNA and Window Forms Pin
larsp77712-Feb-14 1:13
larsp77712-Feb-14 1:13 
GeneralRe: Help needed XNA and Window Forms Pin
DaveyM6912-Feb-14 1:39
professionalDaveyM6912-Feb-14 1:39 
C#
Form1 form = new Form1();
form.Show();
Game1 game = new Game1(form.getDrawSurface());
form.Game = game;  //The new line 
game.GameEvent += HandleGameEvent;
game.Run();

// Inside Form1
private void HandleGameEvent(object sender, EventArgs e)
{
 //
}

public class Game1
{
 public event EventHandler GameEvent;

 protected vitual void OnGameEvent(EventArgs e)
 {
  EventHandler eh = GameEvent;
  if(eh != null)
   eh(this, e);
 }
}

Check out Basic Event Creation in C#[^] and Events Made Simple[^]
Dave

Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.
Astonish us. Be exceptional. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)



GeneralRe: Help needed XNA and Window Forms Pin
larsp77712-Feb-14 4:34
larsp77712-Feb-14 4:34 
GeneralRe: Help needed XNA and Window Forms Pin
Pete O'Hanlon12-Feb-14 4:50
subeditorPete O'Hanlon12-Feb-14 4:50 
AnswerRe: Help needed XNA and Window Forms Pin
Marco Bertschi12-Feb-14 1:40
protectorMarco Bertschi12-Feb-14 1:40 
QuestionRegEx problem with Escape sequences Pin
Marco Bertschi11-Feb-14 23:30
protectorMarco Bertschi11-Feb-14 23:30 
SuggestionRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter11-Feb-14 23:39
professionalKornfeld Eliyahu Peter11-Feb-14 23:39 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi11-Feb-14 23:53
protectorMarco Bertschi11-Feb-14 23:53 
GeneralRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter11-Feb-14 23:57
professionalKornfeld Eliyahu Peter11-Feb-14 23:57 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi12-Feb-14 0:09
protectorMarco Bertschi12-Feb-14 0:09 
GeneralRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter12-Feb-14 0:25
professionalKornfeld Eliyahu Peter12-Feb-14 0:25 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi12-Feb-14 1:06
protectorMarco Bertschi12-Feb-14 1:06 
GeneralRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter12-Feb-14 1:11
professionalKornfeld Eliyahu Peter12-Feb-14 1:11 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi12-Feb-14 1:17
protectorMarco Bertschi12-Feb-14 1:17 
GeneralRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter12-Feb-14 1:25
professionalKornfeld Eliyahu Peter12-Feb-14 1:25 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi12-Feb-14 1:39
protectorMarco Bertschi12-Feb-14 1:39 
GeneralRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter12-Feb-14 1:46
professionalKornfeld Eliyahu Peter12-Feb-14 1:46 
AnswerRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter12-Feb-14 10:13
professionalKornfeld Eliyahu Peter12-Feb-14 10:13 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi12-Feb-14 21:11
protectorMarco Bertschi12-Feb-14 21:11 

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.