-3
가져 난 다음 코드가하고 연구실로 그려진 배열과 출력을 위에있을 때 커서/마우스 위치를 검색하려고 :마우스 위치
Label[ , ] _arr = new Label[4 , 4];
private void Form1_Load(object sender, EventArgs e)
{
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
_arr[i ,j] = new Label();
_arr[i ,j].Text = ""+i+","+j;
_arr[i ,j].Size = new Size(50,50);
_arr[i ,j].Location = new Point(j*50,i*50); //you can set other property here like Border or else
_arr[i, j].BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle ;
this.Controls.Add(_arr[i ,j]);
**label2.Text = _arr[i, j].(System.Windows.Forms.Control.MousePosition).ToString();**
}
}
}
하지만 난에 문제가 있어요 두 별표 내 줄, 아무도 내가이 오류를 해결할 수 있습니까?
어떤 오류가 있습니까? 당신은 하나도주지 않았습니다. –
두 개의 별표를 제거해야합니다. 코드는 거기에서 컴파일되지 않습니다. 그것은 당신에게 구문 오류를 줄 것이다. –
무엇이 문제입니까? 당신이 얻는 결과물과 당신이 기대하는 결과물은 무엇입니까? – matteeyah