开发者

.NET Click Event (WinForms)

I am building a minesweeper and was having difficulties with the mouse event. In the original Windows Minesweeper, the user may c开发者_高级运维lick and drag the mouse while pressing. The new tiles that the user enters while still pressing change to a cleared tile and the previous tile restores back to what it was if it was not clicked. On VB.Net, when I click and attempt to mouse over another tile while still pressing, the other tiles I am on do not appear empty like in the original minesweeper. Any idea on what I could do to fix this issue?

Sorry about that John Saunders, I am new at this site. Thanks for advising me.


You need to supply more details.
I've guessed your code structure and am answering based on my guesses.

You're probably handling the MouseClick event and toggling the tiles.

You need to handle the MouseMove event, and, if the mouse button was pressed (track this in MouseDown and MouseUp, set a variable that gets read in your Paint event to draw the tile.
You could also check the MousePosition property in the Paint event instead of handling MouseMove.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜