开发者

C# TableLayoutPanel MouseMove Too Much CPU

开发者 https://www.devze.com 2022-12-21 03:56 出处:网络
greetings. i have an issue with the following code. for some reason whenever it is executed it is consuming around 60% of the CPU. this is strange, and was wondering if you had any comments?

greetings. i have an issue with the following code. for some reason whenever it is executed it is consuming around 60% of the CPU. this is strange, and was wondering if you had any comments?

    private void HomeTableLayoutPanel_MouseMove(object sender, MouseEventArgs e)
    {

        PictureBox HomeCurrentPicBox = (PictureBox)(HomeTableLayoutPa开发者_运维百科nel.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());
        }
    }

thank you for your time.

edit: im told it is sampling too often. in some aspects this is true in my other semi working code. but my question is too lengthy and i cant explain it. :(


can't you just attach to the mousemove event of the (each?) PictureBox?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号