본문 바로가기

C#

[C#] Invoke, InvokeRequired

반응형

delegate void AddList();

public void Add_cross(){
	try{
		if (this.InvokeRequired){ //다른 스레드에서 접근이 필요하면
			AddList d = new AddList(Add_cross);
			this.Invoke(d, new object[] {});  
		}else
			Add_lstView_Room(strId, strRTitle, strRMaxUser, strOpenRoom);
	}catch (Exception ex){
		wnd.Add_MSG("List 크로스 오류: " + ex.Message);
	}
}

 

반응형