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

C#

 
AnswerRe: Monitor a text file to see when it opens or closes... Pin
DaveyM6914-May-09 7:59
professionalDaveyM6914-May-09 7:59 
AnswerRe: Monitor a text file to see when it opens or closes... Pin
Baeltazor14-May-09 8:04
Baeltazor14-May-09 8:04 
AnswerRe: Monitor a text file to see when it opens or closes... Pin
Engineer Joe14-May-09 8:12
Engineer Joe14-May-09 8:12 
GeneralRe: Monitor a text file to see when it opens or closes... Pin
DaveyM6914-May-09 8:25
professionalDaveyM6914-May-09 8:25 
QuestionC# Direct3D Question Pin
will kirkby14-May-09 7:30
will kirkby14-May-09 7:30 
AnswerRe: C# Direct3D Question Pin
Anthony Mushrow14-May-09 14:01
professionalAnthony Mushrow14-May-09 14:01 
QuestionCustom Control Pin
jammmie99914-May-09 7:11
professionaljammmie99914-May-09 7:11 
AnswerRe: Custom Control Pin
DaveyM6914-May-09 7:26
professionalDaveyM6914-May-09 7:26 
public class MyControl : Control
{
    public event EventHandler DoingSomething;

    public void DoSomething()
    {
        OnDoingSomething(EventArgs.Empty);
    }

    protected virtual void OnDoingSomething(EventArgs e)
    {
        EventHandler eh = DoingSomething;
        if(eh != null)
            eh(this, e);
    }
}
The event handler for this event can be done in the same way as any other control.
See my Events Made Simple[^] article for more info including custom event args etc.

Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: Custom Control Pin
jammmie99914-May-09 8:37
professionaljammmie99914-May-09 8:37 
Questiondatagrid add column Pin
michaelgr114-May-09 6:42
michaelgr114-May-09 6:42 
QuestionProblem to workflow Pin
hdv21214-May-09 6:29
hdv21214-May-09 6:29 
AnswerRe: Problem to workflow Pin
DaveyM6914-May-09 9:06
professionalDaveyM6914-May-09 9:06 
GeneralRe: Problem to workflow Pin
hdv21214-May-09 9:37
hdv21214-May-09 9:37 
QuestionTab to previous control not working. Pin
lastdays14-May-09 6:22
lastdays14-May-09 6:22 
QuestionUserControls [modified] Pin
densher14-May-09 5:51
densher14-May-09 5:51 
QuestionRe: UserControls Pin
Eddy Vluggen14-May-09 6:22
professionalEddy Vluggen14-May-09 6:22 
AnswerRe: UserControls Pin
densher14-May-09 7:19
densher14-May-09 7:19 
NewsRe: UserControls Pin
Eddy Vluggen14-May-09 8:15
professionalEddy Vluggen14-May-09 8:15 
GeneralRe: UserControls Pin
densher14-May-09 8:35
densher14-May-09 8:35 
QuestionSend a struct to external DLL Pin
Ronenb14-May-09 5:47
Ronenb14-May-09 5:47 
AnswerRe: Send a struct to external DLL Pin
DaveyM6914-May-09 7:32
professionalDaveyM6914-May-09 7:32 
GeneralRe: Send a struct to external DLL Pin
Luc Pattyn14-May-09 8:17
sitebuilderLuc Pattyn14-May-09 8:17 
GeneralRe: Send a struct to external DLL Pin
DaveyM6914-May-09 8:32
professionalDaveyM6914-May-09 8:32 
QuestionCreating dynamic controls on a form Pin
fracalifa14-May-09 5:09
fracalifa14-May-09 5:09 
AnswerRe: Creating dynamic controls on a form Pin
Luc Pattyn14-May-09 5:24
sitebuilderLuc Pattyn14-May-09 5:24 

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.