1. Home
  2. Computing & Technology
  3. Visual Basic

Chapter 4 - Working With Menus and Dialog Boxes - Part 1

By , About.com Guide

3 of 4

Menu Tricks ... The Rest of the Story

AlignText Tool

AlignText Tool

TextAlign uses a tool that is new in VB.NET. Rather than just a drop-down list where the words "Middle Center" are selected, a graphical image is used to make the selection:

Timesaving Tip:

When you're entering code such as:

~~~~~~~~~~~~~~~~~~~~~~~~~
Label1.Text = TimeString
~~~~~~~~~~~~~~~~~~~~~~~~~

and

~~~~~~~~~~~~~~~~~~~~~~~~~
Label1.Text = DateString
~~~~~~~~~~~~~~~~~~~~~~~~~

you can save a lot of typing (and typing errors) by copying the code from one place to another. Simply select the text, and then using Ctrl-Click and Drag, copy it to a new location. After that all you have to do is change "Time" to "Date" in the new lines of code.

Understanding the Tool Tip:

The behavior of Access Keys, described in Chapter 4, causes a lot of confusion with programmers. The best way to understand it is to practice with the access keys in VB.NET itself. Let's look at just one access key in VB.NET, selected more or less at random as an example.

Notice that C is an access key in both the File and Edit menu. In File, C is the key to Close while in Edit, C is the key to Copy. So, if you click Alt-C, what happens? Answer: Nothing. There is no C access key in the top menu. You have to click and release the Alt key, and then click either F-C or E-C to to trigger the proper action in Windows XP.

Explore Visual Basic
By Category
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic

©2009 About.com, a part of The New York Times Company.

All rights reserved.