|
VB Helper Newsletter
|
Rod Stephens
|
Dec 06, 2008 07:36 PST
|
If you're interested in reviewing my latest book "Beginning Database
Design Solutions," let me know (RodSte-@vb-helper.com). I may ask
you to pay postage and I have a limited number of copies.
-----
Today's notable book is:
Microsoft Exchange Server 2007 For Dummies
http://www.amazon.com/exec/obidos/ASIN/0471242683/vbhelper/
by John Paul Mueller
John is a talented and amazingly prolific author who's written more than
75 books and 300 articles. He's been technical editor on several of my
books and is an all-around great guy.
Take a look at his books and write a review if you have one.
One more (in case you want to add ribbons to your VBA, VB, or C# apps):
RibbonX For Dummies
http://www.amazon.com/exec/obidos/ASIN/047016994X/vbhelper/
-----
An odd but cool thing happened the other day as I was checking various
Amazon best seller lists: I found three of my books on the lists at the
same time!
"Visual Basic 2008 Programmer's Reference" was #1 on the Visual
Basic list
"Beginning Database Design Solutions" was #17 on the Methodolgy list
"Ready-To-Run Visual Basic Algorithms" was #9 on the Visual Basic
list
The first book is usually on the list somewhere, although #1 is unusual.
The second is new so I'm not sure where it will settle in but lately
it's remained lower down on the list.
The third was a surprise! That book has been out for a while and was
written for VBH 5/6. (I've tried to get the publisher to let me write a
new edition but they say there's isn't enough market.) However, it's
still a pretty introduction and reference for algorithms in Visual
Basic.
In case you're interested, you can access those Amazon top sellers lists
here:
Any Category > Books > Computers & Internet > Microsoft >
Development > Visual Basic
http://www.amazon.com/gp/bestsellers/books/3995
Any Category > Books > Computers & Internet > Computer Science >
Software Engineering > Methodology
http://www.amazon.com/gp/bestsellers/books/280312
(If you look at the description of any book, down in the Product Details
section, you can see the book's sales rank and the categories where it's
listed.)
-----
Have a great week and thanks for subscribing!
Rod
RodSte-@vb-helper.com
----------
*** Now Available ***
Visual Basic 2008 Programmer's Reference
http://www.amazon.com/exec/obidos/ASIN/0470182628/vbhelper/
==========
VB6 Contents:
1. New HowTo: List the fonts available to the printer in Visual Basic 6
VB.NET Contents:
2. New HowTo: Display the number of days, minutes, hours, and seconds
until an event in Visual Basic .NET
Both Contents:
3. New Links
==========
++++++++++
<VB6>
++++++++++
==========
1. New HowTo: List the fonts available to the printer in Visual Basic 6
http://www.vb-helper.com/howto_list_printer_fonts.html
http://www.vb-helper.com/HowTo/howto_list_printer_fonts.zip
When the program's form loads, the code loops through the Printer
object's Fonts collection and adds each font's name to a ListBox.
Private Sub Form_Load()
Dim i As Integer
picSample.AutoRedraw = True
For i = 0 To Printer.FontCount - 1
lstFonts.AddItem Printer.Fonts(i)
Next i
End Sub
When you click on an entry in the ListBox, the program draws a sample of
that font.
Private Sub lstFonts_Click()
If lstFonts.ListIndex < 0 Then Exit Sub
picSample.Font = lstFonts.Text
picSample.Cls
picSample.CurrentX = 0
picSample.CurrentY = 0
picSample.Print lstFonts.Text
End Sub
==========
++++++++++
<VB.NET>
++++++++++
==========
2. New HowTo: Display the number of days, minutes, hours, and seconds
until an event in Visual Basic .NET
http://www.vb-helper.com/howto_net_countdown_timer.html
http://www.vb-helper.com/HowTo/howto_net_countdown_timer.zip
When the program loads, it prompts the user for the event and the time
when it will occur. It displays the event name and enables the form's
Timer.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim event_name As String = InputBox("Event")
If event_name.Length = 0 Then
Me.Close()
Exit Sub
End If
Dim event_date As String = InputBox("Date (e.g. 12/23/09 17:23:00)")
If event_date.Length = 0 Then
Me.Close()
Exit Sub
End If
m_EventDate = CDate(event_date)
lblEvent.Text = event_name
Me.Text = event_name & " at " & m_EventDate
tmrCheckTime.Enabled = True
End Sub
When the Timer's Tick event fires, the program calculates the time
remaining until the event. If the event time has arrived, the program
disables the Timer, maximizes the form, and makes the form topmost. It
hides all controls except the one that displays the event name, which it
centers. Finally it uses the PlaySound API function to play the file
tada.wav.
If the event's time ahs not arrived, the program displays the number of
days, hours, minutes, and seconds remaining.
Private Sub tmrCheckTime_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles tmrCheckTime.Tick
Dim remaining As TimeSpan = m_EventDate.Subtract(Now)
If remaining.TotalSeconds < 1 Then
tmrCheckTime.Enabled = False
Me.WindowState = FormWindowState.Maximized
Me.TopMost = True
For Each ctl As Control In Me.Controls
If ctl Is lblEvent Then
ctl.Location = New Point( _
(Me.ClientSize.Width - ctl.Width) \ 2, _
(Me.ClientSize.Height - ctl.Height) \ 2)
Else
ctl.Visible = False
End If
Next ctl
Try
PlaySound("tada.wav", PlayParam.SND_ASYNC)
Catch ex As Exception
Beep()
End Try
Else
lblDays.Text = remaining.Days & " days"
lblHours.Text = remaining.Hours & " hours"
lblMinutes.Text = remaining.Minutes & " minutes"
lblSeconds.Text = remaining.Seconds & " seconds"
End If
End Sub
To ensure that the file tada.wav is available, I added that file to the
project. I selected the file and, in the Properties window, set its
"Build Action" property to Content and its "Copy to Output Directory"
property to "Copy if newer." Now when the program compiles, it copies
this file into the executable directory if necessary.
==========
++++++++++
<Both>
++++++++++
==========
3. New Links
http://www.vb-helper.com/links.html
CertificationTutorials.com
http://www.certificationtutorials.com/CompTIA/CTT-Plus-certification-training.htm
Just what you'd expect: tutorials for preparing for certifications. A
huge number of tutorials.
Jabaco
http://www.jabaco.org
A free object-oriented, threading-enabled VB 6-like language. (If you
give it a try, email me your experiences at RodSte-@vb-helper.com.)
NewCode
http://www.newcode.com
Tool that converts legacy VB code into VB.NET or C#. Free trial. $99 and
up for full versions.
==========
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
|
|
 |
|