超过事件点击 [英] Making more than event click

查看:69
本文介绍了超过事件点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

拜托,我想知道如何在一个按钮上制作两个事件,如:当我第一次点击按钮显示图像时仍处于调试模式第二次点击

显示另一个image我可以使用哪些代码?

please, I want to know how to make two events on one button like : when i first click on the button display an image and still in the debugging mode the second time i click
display another image what code can i use?

推荐答案

在类级创建一个整数变量,将其设置为1.

每次单击按钮,检查变量的值,如果它大于图​​像数,则将其设置回1.

显示该图像编号。

增加变量下一次。
Create a integer variable at class level, set it to one.
Every time you click the button, check the value of the variable and if it is greater than the number of images, set it back to 1.
Show that image number.
Increment the variable for next time.


作为Griff回答的补充。您可以查看 [ ^ ]关于三态按钮背后逻辑的文章。
As an addition to Griff''s answer. You could look at this[^] article on the logic behind a tri-state button.


这篇关于超过事件点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆