Visual Basic Concepts

Working with Text and Graphics

Visual Basic includes sophisticated text and graphics capabilities for use in your applications. If you think of text as a visual element, you can see that size, shape and color can be used to enhance the information presented. Just as a newspaper uses headlines, columns and bullets to break the words into bite-sized chunks, text properties can help you emphasize important concepts and interesting details.

Visual Basic also provides graphics capabilities allowing you great flexibility in design, including the addition of animation by displaying a sequence of images.

This chapter describes ways of placing and manipulating text and graphics. Details on formatting, fonts, color palettes, and printing are included. By combining these capabilities with good design concepts, you can optimize the attractiveness and ease of use of your applications.

Topics

Working with Fonts

Explains how to choose fonts for your application and set font characteristics.

Displaying Text on Forms and Picture Boxes

Describes using the Print method to print messages to a form, picture box, or printer.

Formatting Numbers, Dates, and Times

How to display numbers, dates, and times in different formats.

Working with Selected Text

Selecting and manipulating text in a text box or combo box.

Transferring Text and Graphics with the Clipboard Object

How to cut, copy, and paste items to the Clipboard.

Understanding the Coordinate System

How to define the location of controls and forms.

Using Graphical Controls

Covers the properties that apply to all the graphical controls.

Using Graphics Methods

How to use the graphics methods to create lines and shapes.

Working with Color

Everything from the basics of color to managing multiple color palettes.

Using the Picture Object

How to manipulate graphics with the Picture object or an array of Picture objects.

Printing

Covers considerations for printing text and graphics from your application.

Sample applications

Blanker.vbp, Palettes.vbp

Some of the code examples in this chapter are taken from the Blanker  (Blanker.vbp)and Palettes (Palettes.vbp) samples. You'll find these applications listed in the directory.