在VB.net标签阵列 [英] Label Array in VB.net

查看:109
本文介绍了在VB.net标签阵列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在阵列 10个标签(标签1,Label2的,LABEL3,Label4,等...),我需要改变正文具有定时财产,我有定时器的工作很好,但我不知道如何在逐个更改标签(本次的LABEL1,下一秒LABEL2,下一秒LABEL3 .. .etc)......

I have 10 labels (Label1, Label2, Label3, Label4, etc...) in an Array and I need to change the Text property with a timer, I have the timer working well, but I don't know how to change one Label at the time( this second the label1, the next second label2, the next second label3...etc)...

我使用VB.NET在Visual Studio .NET的框架4.0。

I'm using VB.NET with the .NET 4.0 Framework in Visual Studio.

谢谢!

推荐答案

如果您已设置定时器和已经工作,尝试这样的事情对你的数组:

If you have the timer set up and working already, try something like this for your array:

'These will be your labels:
Dim oLabel As New Label
Dim oLabel2 As New Label

'Create the array from your labels:
Dim aLabels() As Label = {oLabel, oLabel2}

'loop through your array:
For each oLabel as Label in aLabels

  oLabel.Text = "your text value here"

Next

这篇关于在VB.net标签阵列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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