循环字符或数字视觉基础6 [英] Looping character or number visual basic 6

查看:55
本文介绍了循环字符或数字视觉基础6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

对不起我在vb开始。

我想制作程序循环字符或数字。

只要说我的数字从100到10000.


只是样本:


私有子Timer1_Timer()


如果check1.value = 1则

for i = 100 to 10000

text1.text = i

next i

结束如果


结束sub


但这个循环不像我想要的那样,


我想要所有数字,直到结尾将显示在text1.text上,而不仅仅是最后一个数字10000.我们可以看到循环运行时text1.text上的值是什么。 />
如果i = 10000的值,则从开始重复,直到复选框值= 0,


单击复选框时循环停止,结果text1可以是= 100或500或300或9000等等。


其他任何建议或代码脚本?...

请帮助..


提前感谢

Hi all,
Sorry im beginer in vb.
I want making programm looping character or number.
Just say i have numbers from 100 to 10000.

just sample:

Private Sub Timer1_Timer()

if check1.value= 1 then
for i = 100 to 10000
text1.text= i
next i
end if

end sub

but this looping not like i wanted,

I want all number until the end will be display on text1.text, not just the last number 10000. We can see what the value on text1.text when looping running.
If value of i = 10000 then repeat again from the begining until check box value=0,

when click check box the looping stop, the result text1 can be = 100 or 500 or 300 or 9000 or etc..

any suggestion or code script else?...
please help..

thanks in advance

推荐答案


大家好,

对不起,我很开心vb中的ner。

我想制作程序循环字符或数字。

只要说我的数字从100到10000.


只是样本:


私有子Timer1_Timer()


如果check1.value = 1则

for i = 100 to 10000

text1.text = i

next i

结束如果


结束sub


但这个循环不像我想要的那样,


我想要所有数字,直到结尾将显示在text1.text上,而不仅仅是最后一个数字10000.我们可以看到循环运行时text1.text上的值是什么。 />
如果i = 10000的值,则从开始重复,直到复选框值= 0,


单击复选框时循环停止,结果text1可以是= 100或500或300或9000等等。


其他任何建议或代码脚本?...

请帮助..


提前感谢
Hi all,
Sorry im beginer in vb.
I want making programm looping character or number.
Just say i have numbers from 100 to 10000.

just sample:

Private Sub Timer1_Timer()

if check1.value= 1 then
for i = 100 to 10000
text1.text= i
next i
end if

end sub

but this looping not like i wanted,

I want all number until the end will be display on text1.text, not just the last number 10000. We can see what the value on text1.text when looping running.
If value of i = 10000 then repeat again from the begining until check box value=0,

when click check box the looping stop, the result text1 can be = 100 or 500 or 300 or 9000 or etc..

any suggestion or code script else?...
please help..

thanks in advance



所以你可以使用



So u can use


展开 | 选择 | 换行 | 行号


实际上Ifoel,如果你在循环中放入一个 DoEvents 语句,我认为你的原始代码会起作用。这允许Windows花时间做其他事情,比如更新显示器。


(你可能还需要刷新表单,但我不知道不这么认为。)
Actually Ifoel, I think your original code will work, if you put a DoEvents statement inside the loop. This allows Windows to take time out to do other things, like updating the display.

(You might also need to Refresh the form, but I don''t think so.)


非常感谢Killer42和Hariharanmca ...........

这个非常有用的帮助

.....
Thanks alot Killer42 and Hariharanmca...........
this very help full
.....


这篇关于循环字符或数字视觉基础6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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