C#
2020.09.10 19:02
delegate example
조회 수 43873 추천 수 0 댓글 1
[Child]
public delegate int TR_비밀번호_확인_Handler(string 계좌번호, string 비밀번호);
public event TR_비밀번호_확인_Handler TR_비밀번호_확인_event;
[Parent]
user_계좌정보1.TR_비밀번호_확인_event += TR_비밀번호확인;
Thread 내부에서의 Invoke
if (this.InvokeRequired)
{
this.Invoke(new MethodInvoker(delegate ()
{
당일연산실행_event("KRX", "stock_data2");
}));
}
else
{
당일연산실행_event("KRX", "stock_data2");
}
{
Action action = () =>
{
dataGridView_잔고조회[8, i].Value = string.Format("{0:0.0000}", DNA_INDEX);
};
this.Invoke(action);
}
else
{
dataGridView_잔고조회[8, i].Value = string.Format("{0:0.0000}", DNA_INDEX);
}