Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以指出我正确的方向吗?我试图在按下表单按钮时触发循环。
//伪代码while(button1被按下) value1 += 1 然后松开按钮就停止循环
为了避免使用线程,您可以Timer在表单/控件上添加一个组件,并尝试在鼠标按下时启用它并在鼠标按下时禁用它。然后将通常放入循环中的代码放入Timer_Tick event.
Timer
Timer_Tick event