분류 전체보기 (328)
.NET (111)
S/W tip (35)
etc (63)
DB (34)
HOT item~! (48)
Disign pettens (4)
UX (6)
나의 S/W (2)
개발관련 이슈 (16)
Diary (1)
웹플러스 (1)
calendar
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
tags
archive
link
ColorSwitch 00 01 02
▣  이벤트 이렇게 사용하자~!!!! - .NET/C# - 2009. 4. 16. 23:13
http://blog.daum.net/jcobs/116


이렇게 선언하고

public delegate void dgMethod(Object arg);
public event dgMethod Method;
protected void OnMethod(Object arg)
{
    if (Method != null) Method(arg); 
}

 

이렇게 사용한다.

void btn_Click(object sender, EventArgs e)
{
    OnMethod("Button Clickend");
}

 

실제 사용 예)

        delegate void DGControl_TimeBar(int timing);
        DGControl_TimeBar dgControl_TimeBar = null;
        void ProgressBar(int timing)
        {
            this.TimeBar(timing);
        }
        public void ProgressBar_Time(int timing)
        {
            Invoke(dgControl_TimeBar, timing);
        }

 

dgControl_TimeBar = new DGControl_TimeBar(ProgressBar);

 

 


articles
recent replies
recent trackbacks
notice
Admin : New post