【发布时间】:2010-02-26 14:45:11
【问题描述】:
问候。我对以下代码有疑问。由于某种原因,无论何时执行它都会消耗大约 60% 的 CPU。这很奇怪,想知道你是否有任何 cmets?
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());
}
}
感谢您的宝贵时间。
编辑:我告诉它采样太频繁了。在某些方面,这在我的其他半工作代码中是正确的。但我的问题太长了,我无法解释。 :(
【问题讨论】: