|
-
Oct 18th, 2000, 01:30 PM
#1
Thread Starter
Hyperactive Member
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 
[Edited by Matt-D on 10-18-2000 at 02:32 PM]
-
Oct 18th, 2000, 02:17 PM
#2
Junior Member
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
-
Oct 18th, 2000, 02:28 PM
#3
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
-
Oct 18th, 2000, 02:31 PM
#4
Code:
Randomize
Num = Int(Rnd * Screen.FontCount)
Me.FontName = Screen.Fonts(Num)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|