c# 언어
컨트롤에 포커스가 자동으로 안갈 때
여린완자
2021. 7. 6. 17:37
#컨트롤에 포커스가 자동으로 안갈 때
#컨트롤에 포커스가 자동으로 안갈 때
#컨트롤에 포커스가 자동으로 안갈 때
#컨트롤에 포커스가 자동으로 안갈 때
case WM_PAINT:
if(toggle==0)
{
this.Size = new Size(1000,600);
this.Text = "TRIS BY CONSOLE FORM";
graphics = CreateGraphics();
font = new Font("바탕체", 17, FontStyle.Bold);
toggle=100;
timer = new System.Timers.Timer();
timer.Interval = 800;
timer.Elapsed += new ElapsedEventHandler(__time_tick);
timer.Start();
mainBackColor = this.BackColor;
MessageBox.Show("TRIS START, Time Interval:" + timer.Interval);
//Form에 focus가 가도록 하기. 키보드 컨트롤을 이용할수 있다.
this.Activate();
this.Focus();
var handle = GetConsoleWindow();
ShowWindow(handle, SW_HIDE); // 숨기기
init(ref t_tris, ref xpos, ref ypos, ref __design);
DrawTerisAll(t_tris);
}
break;