关于带有计时器的列表框和标签 [英] About List Box and Labels with Timer

查看:139
本文介绍了关于带有计时器的列表框和标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,我正在使用visual basic 2008制作一个发送短信的程序。我对ListBox和带标签的标签有一些困难。请帮我解决我的问题。

我的问题是:



1 - 我有一个带有手机号码的ListBox作为Listbox的项目。

2-我有3个标签。

   (第一个标签用于显示列表框项目)

   (第二个标签用于显示计数1到10)

   (第三个标签用于显示结果,如发送,确定)



我的问题是当用户点击发送消息按钮时。然后label1 show第一项,标签2开始计数1到10,完成后计数第三个标签显示结果如发送即可。



此第一个标签后再显示列表框项目没有2并计算开始等等。当完成列表框中的所有项目时,一条消息显示操作已完成。



请帮助我在这件事上。



我使用下面的代码,但这段代码只显示计数和结果。

Dear to All,I am making a program in visual basic 2008 for sending SMS.I have some Difficulties with ListBox and Labels with Timer.Please help me for solving my questions.
My questions are :

1 - I have a ListBox with Mobile Numbers as items of Listbox.
2- I have 3 Labels.
   (First label is for showing listbox item)
   (2nd Label is for showing counting 1 to 10)
   (3rd Label is for showing Result such as Sending,Ok)

My question is that when user click the Send Message button.Then label1 show First item , label 2 start counting 1 to 10,after completing counting 3rd label show result such as Sending Is ok.

After this first label again show listbox item no 2 and counting againg start and so on.When completed all the Items in listbox , A message show us that Operation has Completed.

Please help me in this matter.

I have use following code but this code only show counting and result .

For i = 0 To ListBox1.Items.Count - 1
    ListBox1.SelectedItem = ListBox1.SelectedItem + 1
    Label1.Text = ListBox1.SelectedItem
    Timer1.Start()
    Timer1.Interval = 1000
    Label2.Text += 1
    If Label2.Text = 10 Then
        Label3.Text = "Message has sent"
        Timer1.Stop()
        ListBox1.SelectedItem = ListBox1.SelectedItem + 1
    End If
Next i



请帮助我。谢谢


please help me.Thanks

推荐答案

查看类似的问题和解答:一次取一个列表框项目然后执行代码 [ ^ ]
Have a look at similar question and answers: Take One List Box Item At A Time Then Perform Code[^]


这篇关于关于带有计时器的列表框和标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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