|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Tip of The DayHi! How to create an application that can show strings in a random
order? I tried to create an array of string and then use Randomize() method by all my strings were shown one by one... Laserson,
Why use a randomized order when you can set an index number in the register, than you are as well able to give your tips in a good sequence? I hope this helps, Cor Show quoteHide quote "Laserson" <laser***@yandex.ru> schreef in bericht news:OAEzt6SvGHA.1512@TK2MSFTNGP04.phx.gbl... > Hi! How to create an application that can show strings in a random order? > I tried to create an array of string and then use Randomize() method by > all my strings were shown one by one... Hello,
small example. Hope, it helps you. Public Class Form1 Dim tips() As String Const NO_OF_TIPS As Int32 = 15 Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ' Setup tips (may be loaded from file in future) ReDim tips(NO_OF_TIPS - 1) For tip As Int32 = 0 To NO_OF_TIPS - 1 tips(tip) = "Tip no. " & tip.ToString Next tip Randomize() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Show a tip Dim randomTip As Int32 = CInt(Rnd() * NO_OF_TIPS) MsgBox(tips(randomTip)) End Sub End Class Greetings, Lars Show quoteHide quote "Laserson" <laser***@yandex.ru> schrieb im Newsbeitrag news:OAEzt6SvGHA.1512@TK2MSFTNGP04.phx.gbl... > Hi! How to create an application that can show strings in a random order? > I tried to create an array of string and then use Randomize() method by > all my strings were shown one by one...
Can a .NET Web Service be accessed from a VB6 Client?
Is there a statement that will completely empty a listbox? Event handlers Threading Question Reporting options in vb 2005 How to code image path relative to project Application Priority Debug Windows Services is My.Settings version specific? DataGrid Row Labeling |
|||||||||||||||||||||||