问候。我对以下代码有疑问。由于某种原因,无论何时执行它都会消耗大约 60% 的 CPU。这很奇怪,想知道您是否有任何意见?
private void HomeTableLayoutPanel_MouseMove(object sender, MouseEventArgs e)
{
PictureBox HomeCurrentPicBox = (PictureBox)(HomeTableLayoutPanel.GetChildAtPoint(e.Location));
TableLayoutPanelCellPosition HomeCurrentPosition = new TableLayoutPanelCellPosition(-1, -1);
if (HomeCurrentPicBox != null)
{
HomeCurrentPosition = HomeTableLayoutPanel.GetCellPosition(HomeCurrentPicBox);
gameFormToolTip.SetToolTip(HomeTableLayoutPanel, GameModel.alphaCoords(HomeCurrentPosition.Column) + "," + HomeCurrentPosition.Row.ToString());
}
}
感谢您的时间。
编辑:我告诉它采样太频繁了。在某些方面,这在我的其他半工作代码中是正确的。但我的问题太长了,我无法解释。:(