Click here to Skip to main content
15,909,898 members
Home / Discussions / C#
   

C#

 
Generalhilf mir! Pin
Pyro Joe24-Dec-04 12:51
Pyro Joe24-Dec-04 12:51 
GeneralRe: hilf mir! Pin
Stefan Troschuetz24-Dec-04 22:15
Stefan Troschuetz24-Dec-04 22:15 
GeneralInternet in C# Pin
| Muhammad Waqas Butt |24-Dec-04 11:54
professional| Muhammad Waqas Butt |24-Dec-04 11:54 
GeneralRe: Internet in C# Pin
Member 158368224-Dec-04 20:59
Member 158368224-Dec-04 20:59 
GeneralInternet in C# Pin
| Muhammad Waqas Butt |24-Dec-04 23:39
professional| Muhammad Waqas Butt |24-Dec-04 23:39 
GeneralRe: Internet in C# Pin
Dennis C. Dietrich24-Dec-04 23:54
Dennis C. Dietrich24-Dec-04 23:54 
GeneralC#.Net Events Pin
| Muhammad Waqas Butt |24-Dec-04 11:12
professional| Muhammad Waqas Butt |24-Dec-04 11:12 
GeneralRe: C#.Net Events Pin
Colin Angus Mackay24-Dec-04 13:12
Colin Angus Mackay24-Dec-04 13:12 
You should look at redesigning the code a little. You should not call one event handler from another, IMO.

You should create a method that performs the actions for the event, and then call that action from the two separate event handlers. That way your code is cleaner and if you ever decide to add functionality to one of the events but not the other you can change it more easily.

For example:
private void DoCloseAction()
{
    // Perform the actions for closing the form
}

private void SomeForm_Closed(object sender, EventArgs e)
{
    DoCloseAction();
}

private void CloseButton_Click(object sender, EventArgs e)
{
    DoCloseAction();
}


Does this help?


Do you want to know more?
WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums


GeneralRe: C#.Net Events Pin
| Muhammad Waqas Butt |24-Dec-04 23:31
professional| Muhammad Waqas Butt |24-Dec-04 23:31 
GeneralRe: C#.Net Events Pin
Colin Angus Mackay25-Dec-04 13:31
Colin Angus Mackay25-Dec-04 13:31 
GeneralC#.Net Events again Pin
| Muhammad Waqas Butt |24-Dec-04 23:33
professional| Muhammad Waqas Butt |24-Dec-04 23:33 
Generalapplication close Pin
Pyro Joe24-Dec-04 9:03
Pyro Joe24-Dec-04 9:03 
GeneralRe: application close Pin
leppie24-Dec-04 9:48
leppie24-Dec-04 9:48 
GeneralRe: application close Pin
Pyro Joe24-Dec-04 10:53
Pyro Joe24-Dec-04 10:53 
GeneralRe: application close Pin
Colin Angus Mackay24-Dec-04 13:06
Colin Angus Mackay24-Dec-04 13:06 
GeneralRe: application close Pin
Pyro Joe24-Dec-04 13:18
Pyro Joe24-Dec-04 13:18 
GeneralRe: application close Pin
Colin Angus Mackay24-Dec-04 13:22
Colin Angus Mackay24-Dec-04 13:22 
GeneralRe: application close Pin
Pyro Joe24-Dec-04 13:42
Pyro Joe24-Dec-04 13:42 
GeneralRe: application close Pin
Colin Angus Mackay24-Dec-04 14:26
Colin Angus Mackay24-Dec-04 14:26 
GeneralRe: application close Pin
Pyro Joe24-Dec-04 15:03
Pyro Joe24-Dec-04 15:03 
GeneralRe: application close Pin
Kiran Satish25-Dec-04 18:05
Kiran Satish25-Dec-04 18:05 
GeneralrichTextBox string colors Pin
Pyro Joe24-Dec-04 8:16
Pyro Joe24-Dec-04 8:16 
GeneralRe: richTextBox string colors Pin
TyronX24-Dec-04 23:53
TyronX24-Dec-04 23:53 
GeneralRe: richTextBox string colors Pin
Kiran Satish25-Dec-04 18:09
Kiran Satish25-Dec-04 18:09 
GeneralStackOverflow - C# Windows application Pin
fiofio24-Dec-04 4:55
fiofio24-Dec-04 4:55 

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.