Welcome Guest!
 VB 6 Helper
 Previous Message All Messages Next Message 
VB 6 Helper Newsletter  Rod Stephens
 Oct 24, 2011 09:26 PDT 

Lots of links this time.
Author John Mueller has posted a series of articles about his
GrabAPicture program. That program records a series of locations online
or on his computers and then picks pictures from them to display as
wallpaper. In addition to providing some useful features, the program
demonstrates a bunch of useful software design techniques.

These articles are much more in-depth than the abbreviated examples that
I usually post. When you have a chance, take a look!







On his RealWorldWPDev website, Matt Hidinger is posting a series of
articles about Windows Phone development. This series will walk through
development of a stock tracking application for the Windows Phone. See
the introduction and outline at:


Build Windows has a series of hands-on labs to help get you ready for
Windows 8. Some of the more interesting ones include:

    Building Your First Metro Style App Using C# and Visual Basic
    A Tour of Building Metro Style Apps Using C# and Visual Basic Part 1
    A Tour of Building Metro Style Apps Using C# and Visual Basic Part 2
    Exploring Data Binding in Metro Style Apps Using C# and Visual Basic
    Using Windows 8 Controls in your Metro Style Apps Built Using C# and
Visual Basic
    Working with Games in Visual Studio
    Direct3D Tutorial
    Basic Photo Processing with Direct2D Effects
    Using Windows 8 Templates to Build Metro Style Apps Using C# and
Visual Basic

You can find these at:

To help prepare you for Visual Studio 11, you can download the VS 11
Developer Preview Training Kit at:


The press release says:

    This kit includes hands-on labs to help you understand how to take
    of the variety of enhancements in Visual Studio 11 and the .NET
Framework 4.5,
    how to support and manage the entire application lifecycle and how
to build
    Windows Metro style apps.

The kit covers topics including:

A Lap Around the Visual Studio 11 Development Environment
Asynchronous Programming in .NET 4.5 with C# and Visual Basic
What's New in ASP.NET and Visual Studio 11 Developer Preview
Making Developers More Productive with Team Foundation Server 11

You can download the Training Kit from:

Visual Basic 24-Hour Trainer

Unique book-and-DVD package for novice Visual Basic programmers

Start from scratch, and even if you don't know a thing about Visual
Basic, you soon will with this thorough introduction to Visual Basic
programming. Using easy-to-follow lessons and step-by-step instruction,
this practical book teaches you concepts and hands-on techniques, then
reinforces your learning with video screencasts and supplemental
materials. Follow the exercises, then access the Try It section on the
DVD, and watch as well-known VB authority and author Rod Stephens works
through programming problems.
Have a great week and thanks for subscribing!


Twitter feeds:

    VB6 Contents:
1. New HowTo: Calculate mileage and fuel consumption in the United
States, United Kingdom, and metric units in Visual Basic 6
1. New HowTo: Calculate mileage and fuel consumption in the United
States, United Kingdom, and metric units in Visual Basic 6

People in the United States, Canada, the United Kingdom, and several
other places measure a car's <b>fuel efficiency</b> in miles per gallon.
As you might expect, countries that use the metric system may measure
fuel efficiency in kilometers per liter, but many of them also measure a
car's <b>fuel consumption</b> in liters per 100 kilometers. To make
matters even more confusing, the United Kingdom, Canada, and others use
an imperial gallon, which is different from an American gallon, so you
can't easily compare values in miles per gallon across different

This example calculates fuel efficiency in all three systems: US miles
per gallon, UK miles per gallon, and liters per 100 kilometers. The
program uses the following code to perform its calculations.

' Conversion factors.
Private Const miles_per_km As Single = 0.621371192
Private Const us_gallons_per_liter As Single = 0.264172052637296
Private Const uk_gallons_per_liter As Single = 0.2199692483

' Calculate the mileage statistics.
Private Sub cmdCalculate_Click()
Dim miles As Single
Dim gallons As Single
Dim us_mpg As Single
Dim us_gal_per_100_miles As Single
Dim uk_gals As Single
Dim uk_mpg As Single
Dim uk_gal_per_100_miles
Dim liters As Single
Dim kilometers As Single
Dim km_per_liter As Single
Dim l_per_100_km As Single

    ' Get the inputs.
    miles = Val(txtDistance.Text)
    gallons = Val(txtFuel.Text)

    ' Convert to miles and US gallons.
    If (optKilometers.Value) Then miles = miles * miles_per_km
    If (optUkGallons.Value) Then
        gallons = gallons * us_gallons_per_liter / uk_gallons_per_liter
    ElseIf (optKilometers.Value) Then
        gallons = gallons * us_gallons_per_liter
    End If

    ' Calculate performance values.
    us_mpg = miles / gallons
    us_gal_per_100_miles = 100 / us_mpg

    ' US values.
    txtUsMpg.Text = Format$(us_mpg, "0.00")
    txtUsGalPer100Miles.Text = Format$(us_gal_per_100_miles, "0.00")

    ' UK values.
    uk_gals = gallons * uk_gallons_per_liter / us_gallons_per_liter
    uk_mpg = miles / uk_gals
    uk_gal_per_100_miles = 100 / uk_mpg
    txtUkMpg.Text = Format$(uk_mpg, "0.00")
    txtUkGalPer100Miles.Text = Format$(uk_gal_per_100_miles, "0.00")

    ' Metric values.
    liters = gallons / us_gallons_per_liter
    kilometers = miles / miles_per_km
    km_per_liter = kilometers / liters
    l_per_100_km = 100 / km_per_liter
    txtKpl.Text = Format$(km_per_liter, "0.00")
    txtLitersPer100km.Text = Format$(l_per_100_km, "0.00")
End Sub

The code starts by defining some conversion factors to translate between
different units of measurement.

Next the program gets the user's inputs and converts them into miles and
US gallons. A handy trick for working with multiple units is to first
convert the inputs into some known unit. In this example I've chosen
miles and US gallons, but you could use whatever units you prefer.

The code then calculates miles per gallons and US gallons per 100 miles,
and displays the result. After that the code simply converts those value
into other units of measure and displays their results.

Twitter feeds:

Post questions at:
 Previous Message All Messages Next Message 
  Check It Out!

  Topica Channels
 Best of Topica
 Art & Design
 Books, Movies & TV
 Food & Drink
 Health & Fitness
 News & Information
 Personal Finance
 Personal Technology
 Small Business
 Travel & Leisure
 Women & Family

  Start Your Own List!
Email lists are great for debating issues or publishing your views.
Start a List Today!

© 2001 Topica Inc. TFMB
Concerned about privacy? Topica is TrustE certified.
See our Privacy Policy.