|
VB 6 Helper Newsletter
|
Rod Stephens
|
Dec 28, 2008 12:19 PST
|
I don't remember if I mentioned this book excerpt. It came out a while
ago but I didn't see it on my Online Articles page
(http://www.vb-helper.com/online_articles.html).
DevX: Book Excerpt: Visual Basic 2005 with .NET 3.0 Programmer's
Reference
http://www.devx.com/dotnet/Article/37432
March 12, 2008
This chapter explains how to print in .NET. It was written for
Visual Basic 2005 with the .NET Framework 3.0 but works with other
versions, too.
It's a good explanation of printing in Visual Basic .NET.
-----
Happy Holidays!
Rod
RodSte-@vb-helper.com
----------
*** Now Available ***
Beginning Database Design Solutions
http://www.amazon.com/exec/obidos/ASIN/0470385499/vbhelper/
Visual Basic 2008 Programmer's Reference
http://www.amazon.com/exec/obidos/ASIN/0470182628/vbhelper/
==========
VB6 Contents:
1. New HowTo: Randomize a list of names in Visual Basic 6
Both Contents:
2. New Links
==========
++++++++++
<VB6>
++++++++++
==========
1. New HowTo: Randomize a list of names in Visual Basic 6
http://www.vb-helper.com/howto_radomize_name_list.html
http://www.vb-helper.com/HowTo/howto_radomize_name_list.zip
I recently used this program to select random people to receive free
books.
Enter the list of names that you want to randomize in the Split
statement.
The program uses Split to break the names apart and put them in an
array. It then randomizes the array.
(For each position i in the array except the last one, the program
randomly picks an index j between i and the end of the array. It then
swaps the item at position j into position i.)
The program then displays the list in its randomized order.
Private Sub cmdRandomize_Click()
Dim names() As String
Dim i As Integer
Dim j As Integer
Dim tmp As String
Dim txt As String
' Put the names in an array.
names = Split("Alice;Ben;Cindy;Dan;Erica;Frank", ";")
' Randomize the array.
Randomize
For i = LBound(names) To UBound(names) - 1
' Pick a random entry.
j = Int((UBound(names) - i + 1) * Rnd + i)
' Swap the names.
tmp = names(i)
names(i) = names(j)
names(j) = tmp
Next i
' Display the results.
For i = LBound(names) To UBound(names)
txt = txt & vbCrLf & i & ": " & names(i)
Next i
txt = Mid$(txt, Len(vbCrLf) + 1)
txtResults.Text = txt
End Sub
To pick N names from the list, simply use the first N as they are
presented randomly.
==========
++++++++++
<Both>
++++++++++
==========
2. New Links
http://www.vb-helper.com/links.html
Intertech.com
http://www.intertech.com
Instructor-led training on VB.NET and other .NET technologies such as
WPF, C#, and Silverlight.
Nordicaccess
http://www.nordicaccess.com
A dozen or so Visual Basic examples and videos.
Mr. Bool
http://www.mrbool.com
A bunch of short, free video tutorials (around 15 minutes each) on
Visual Basic, C#, etc.
==========
Archives:
http://www.topica.com/lists/VBHelper
http://www.topica.com/lists/VB6Helper
http://www.topica.com/lists/VBNetHelper
http://www.vb-helper.com/cgi-bin/mojo/mojo.cgi?flavor=archive&list=VB_Helper_Newsletter
Post questions at:
http://www.topica.com/lists/VBHelperQA
|
|
 |
|