Click here to Skip to main content
15,916,091 members
Home / Discussions / C#
   

C#

 
AnswerRe: access controls in form1 from form2 Pin
Robert Rohde24-Nov-05 7:08
Robert Rohde24-Nov-05 7:08 
GeneralRe: access controls in form1 from form2 Pin
Sam 200624-Nov-05 7:34
Sam 200624-Nov-05 7:34 
AnswerRe: access controls in form1 from form2 Pin
Curtis Schlak.24-Nov-05 14:16
Curtis Schlak.24-Nov-05 14:16 
GeneralRe: access controls in form1 from form2 Pin
Sam 200624-Nov-05 17:36
Sam 200624-Nov-05 17:36 
QuestionReflection, Breakpoints and Debug Mode Assembllies Pin
Tristan Rhodes24-Nov-05 5:58
Tristan Rhodes24-Nov-05 5:58 
AnswerRe: Reflection, Breakpoints and Debug Mode Assembllies Pin
leppie24-Nov-05 11:00
leppie24-Nov-05 11:00 
QuestionProblem with events Pin
sciamachy24-Nov-05 5:48
sciamachy24-Nov-05 5:48 
AnswerRe: Problem with events Pin
Leslie Sanford24-Nov-05 6:58
Leslie Sanford24-Nov-05 6:58 
sciamachy wrote:

public Beagle()
{
new Beagle(0,0);
}


Hmm, this allocates a new instance of the Beagle class without assigning it to anything. Unless this is a construct new to C# v2.0 that I'm not aware of, I don't think you're accomplishing anything. Someone help me out here, if I'm wrong.

To initialize your fields, you can do this:

public Beagle()
{
    this.x = 0;
    this.y = 0;
    this.uptodate = true;
}


sciamachy wrote:
// Update world
Movement();


Oops! You're raising the event without checking to see if it is null. If no one has yet subscribed to the event when you attempt to raise it, you'll get a null exception.

Better to do something like this:

protected virtual void OnMovement()
{
    MovementEventHandler handler = Movement;

    if(handler != null)
    {
        handler();
    }
}


And call this method from elsewhere in your class when you need to raise the event.
QuestionTreeView question. Pin
zaboboa24-Nov-05 4:26
zaboboa24-Nov-05 4:26 
AnswerRe: TreeView question. Pin
Robert Rohde24-Nov-05 4:39
Robert Rohde24-Nov-05 4:39 
QuestionMethod parameters Pin
1nsp1r3d24-Nov-05 3:15
1nsp1r3d24-Nov-05 3:15 
AnswerRe: Method parameters Pin
Leslie Sanford24-Nov-05 3:40
Leslie Sanford24-Nov-05 3:40 
GeneralRe: Method parameters Pin
Colin Angus Mackay24-Nov-05 4:15
Colin Angus Mackay24-Nov-05 4:15 
AnswerRe: Method parameters Pin
Colin Angus Mackay24-Nov-05 4:25
Colin Angus Mackay24-Nov-05 4:25 
GeneralRe: Method parameters Pin
Leslie Sanford24-Nov-05 4:46
Leslie Sanford24-Nov-05 4:46 
GeneralRe: Method parameters Pin
Colin Angus Mackay24-Nov-05 4:58
Colin Angus Mackay24-Nov-05 4:58 
GeneralRe: Method parameters Pin
Leslie Sanford24-Nov-05 5:34
Leslie Sanford24-Nov-05 5:34 
GeneralRe: Method parameters Pin
Colin Angus Mackay24-Nov-05 5:44
Colin Angus Mackay24-Nov-05 5:44 
AnswerRe: Method parameters Pin
Colin Angus Mackay24-Nov-05 5:02
Colin Angus Mackay24-Nov-05 5:02 
QuestionData types in reports (rdls) Pin
doph24-Nov-05 1:50
doph24-Nov-05 1:50 
QuestionConverting decimal to String Pin
Subrahmanyam K24-Nov-05 1:37
Subrahmanyam K24-Nov-05 1:37 
AnswerRe: Converting decimal to String Pin
J4amieC24-Nov-05 2:02
J4amieC24-Nov-05 2:02 
AnswerRe: Converting decimal to String Pin
Craig G Fraser24-Nov-05 2:04
Craig G Fraser24-Nov-05 2:04 
QuestionRegarding Strong name Pin
A.Grover24-Nov-05 1:23
A.Grover24-Nov-05 1:23 
AnswerRe: Regarding Strong name Pin
S. Senthil Kumar24-Nov-05 2:19
S. Senthil Kumar24-Nov-05 2:19 

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.