-
1:
How do I use a random to get every time a different font?
VB 3.0
2:
Is it possible to make a random which selects a file in
a folder to open it (picture, text,...) ?
VB 6.0
Thanks for some advice, Matt-D :rolleyes:
[Edited by Matt-D on 10-18-2000 at 02:32 PM]
-
hi there,
use this code for 2nd Q
dim Rando as integer
call dir("c:\path")
randomize
Rando = int ( rnd * 50)
for i = 1 to rando
call dir
next i
msgbox "c:\path\" & dir
-
Q1:
Have a listbox hidden.
Code:
Function randomnumber(finished)
Randomize
randomnumber = Int((Val(finished) * Rnd) + 1)
End Function
Private Sub Form_Load()
For i = 0 To Screen.FontCount - 1
List1.AddItem (Screen.Fonts(i))
Next i
End Sub
Private Sub Command1_Click()
List1.ListIndex = randomnumber(List1.ListCount)
End Sub
Private Sub List1_Click()
Text1.Font.Name = List1.Text
End Sub
-
Code:
Randomize
Num = Int(Rnd * Screen.FontCount)
Me.FontName = Screen.Fonts(Num)