delegate string GetTextCallback();
public string GetText()
{
    if (this.cb_DataSelectTime.InvokeRequired)
    {
        GetTextCallback callback = new GetTextCallback(GetText);
        return (string) this.Invoke(callback, new object[] { });
    }
    else
    {
        return this.cb_DataSelectTime.Text;
    }
}

delegate void SetTextCallback();
public string SetText()
{
    if (this.cb_DataSelectTime.InvokeRequired)
    {
        SetTextCallback callback = new GetTextCallback(SetText);
        return (string) this.Invoke(callback, new object[] { });
    }
    else
    {
        return this.cb_DataSelectTime.Text;
    }
}


일단 Set 과 Get형식의 델리게이트..

UI의 값을 참조시에는 Delegate와 INvokeRequired를 사용하여 호출 해주어야 한다.....

왜?? 아직 잘모르겠따 ㅡㅡ;;;;
생각보다 delegate가 먼말인지 모르겠돠 ㅡㅡ;;; 쟁장..

Posted by 나비:D
:
BLOG main image
by 나비:D

공지사항

카테고리

분류 전체보기 (278)
Programming? (0)
---------------------------.. (0)
나비의삽질 (5)
Application (177)
SQL (51)
Web (27)
etc. (14)
Omnia (0)
---------------------------.. (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

달력

«   2024/04   »
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
Total :
Today : Yesterday :