Section 1.2. Using Windows


[Page 4 (continued)]

1.2. Using Windows

Programs such as Visual Basic, which are designed for Microsoft Windows, are easy to useonce you learn a little jargon and a few basic techniques. This section explains the jargon, giving you enough understanding of Windows to get you started in Visual Basic. Although Windows may seem intimidating if you've never used it before, you need to learn only a few basic techniques, which are covered in this section.


[Page 5]

Mouse Pointers

When you use Windows, think of yourself as the conductor and Windows as the orchestra. The conductor in an orchestra points to various members and does something with his or her baton; then the orchestra members respond in certain ways. For a Windows user, the baton is called the pointing device; most often it is a mouse. As you move the mouse across your desk, a pointer moves along the screen in sync with your movements. Two basic types of mouse pointers you will see in Windows are an arrow and an hourglass.

The arrow is the ordinary mouse pointer you use to point at various Windows objects before activating them. You will usually be told to "Move the pointer to ...." This really means "Move the mouse around your desk until the mouse pointer is at ...."

The hourglass mouse pointer pops up whenever Windows is saying "Wait a minute; I'm thinking." This pointer still moves around when you move the mouse, but you can't tell Windows to do anything until it finishes what it's doing and the mouse pointer no longer resembles an hourglass. (Sometimes you can press the Esc key to tell Windows to stop what it is doing.)

Note: The mouse pointer can take on many other shapes, depending on which application you are using and what task you are performing. For instance, when entering text in a word processor or Visual Basic, the mouse pointer appears as a thin, large, uppercase I (referred to as an I-beam).

Mouse Actions

After you move the (arrow) pointer to a place where you want something to happen, you need to do something with the mouse. There are five basic things you can do with a mousepoint, hover, click, double-click, and drag.

Pointing means moving your mouse across your desk until the mouse pointer is over the desired object on the screen.

Hovering means lingering the mouse at a particular place and waiting for a message or menu to appear.

Clicking (sometimes people say single-clicking) means pressing and releasing the left mouse button once. Whenever a sentence begins "Click on ...," you need to

1.

move the mouse pointer until it is at the object you are supposed to click on and

2.

press and release the left mouse button.

An example of a sentence using this jargon might be "Click on the button marked Yes." You also will see sentences that begin "Click inside the ...." This means to move the mouse pointer until it is inside the boundaries of the object, and then click.

Double-clicking means clicking the left mouse button twice in quick succession (that is, pressing it, releasing it, pressing it, and releasing it again quickly so that Windows doesn't think you single-clicked twice). Whenever a sentence begins "Double-click on ...", you need to

1.

move the mouse pointer until it is at the object you are supposed to double-click on and

2.

press and release the left mouse button twice in quick succession.


[Page 6]

For example, you might be instructed to "Double-click on the little box at the far left side of your screen."

Note: An important Windows convention is that clicking selects an object so you can give Windows or the document further directions about it, but double-clicking tells Windows to perform a default operation. For example, double-clicking on a folder will open that folder.

Dragging usually moves a Windows object. If you see a sentence that begins "Drag the ...", you need to

1.

move the mouse pointer until it is at the object,

2.

press the left mouse button and hold it down,

3.

move the mouse pointer until the object moves to where you want it to be, and

4.

finally, release the mouse button.

Sometimes this whole activity is called drag and drop.

Windows Start Button

Clicking on the Start button at the bottom left corner of the screen displays a menu that you can use to run programs, shut down Windows, and carry out several other tasks. The Start menu also can be accessed by pressing a special key labeled with the Windows logo (located next to the Alt key) or by pressing Ctrl + Esc. (In the notation "key1 + key2", the plus sign (+) instructs you to hold down key1 and then press key2. There are many useful key combinations of this type.)

Windows and Its Little Windows

Windows gets its name from the way it organizes your screen into rectangular regions. When you run a program, the program runs inside a bordered rectangular box. Unfortunately Windows jargon calls all of these windows, so there's only a lowercase "w" to distinguish them from the operating system called Windows.

When Windows' attention is focused on a specific window, the Title bar at the top of the window is blue and the window is said to be active. (Inactive windows have a gray Title bar.) The active window is the only one that can be affected by your actions. An example of a sentence you might see is "Make the window active." This means that if the Title bar of the window is gray, click inside the window. At this point, the active window will be responsive to your actions.

Using Notepad

We will explore the Windows application Notepad to illustrate the Windows environment. Notepad is used extensively in this text to create text files for programs. Most of the concepts learned here carry over to Visual Basic and other Windows applications.

To invoke Notepad from Windows, click the Start button, click on Run, type "Notepad" into the box labeled "Name:", and click the OK button. The window in Figure 1.1 will appear. As its name suggests, Notepad is an elementary word processor. You can type text into the Notepad window, edit the text, print the text on the printer, and save the text for later recall.


[Page 7]

Figure 1.1. The Notepad window.


The blinking vertical line is called the cursor. Each letter you type will appear at the cursor. The Notepad window is divided into four parts. The part containing the cursor is called the Work area. It is the largest and most important part of the window because documents are typed into this window.

The Title bar at the top of the screen holds the name of the document currently being written. Until the document is given a name, the document is called "Untitled." The three buttons on the right side of the title bar can be used to maximize, minimize, or close the window. You can click on the Maximize button to make the Notepad window fill the entire screen, click on the Minimize button to change the Notepad window into a button on the taskbar, or click on the Close button to exit Notepad. As long as a window isn't maximized or minimized, you can usually move it around the screen by dragging its title bar. (Recall that this means to move the mouse pointer until it is in the title bar, hold down the left mouse button, move the mouse until the window is where you want it to be, and then release the mouse button.)

Note 1: After you have maximized a window, the Maximize button changes to a pair of rectangles called the Restore button. Click on this button to return the window to its previous size.

Note 2: If the Notepad window has been minimized, it can be restored to its previous size by clicking on the button that was created on the task bar when the application was opened. (The three tasks discussed in this paragraph also can be carried out with the System Menu button in the upper-left corner of the window.)

You can change the Notepad window to suit your needs. To adjust the size, do the following:

1.

Move the mouse pointer until it is at the place on the boundary you want to adjust. The mouse pointer changes to a double-headed arrow.

2.

Drag the border to the left or right or up or down to make the window smaller or larger.

3.

When you are satisfied with the new size of the window, release the left mouse button.


[Page 8]

If the Work area contains more information than can fit on the screen, you need a way to move through this information so you can see it all. For example, you will certainly be writing instructions in Visual Basic that are longer than one screen. You can use the mouse to scroll through your instructions with small steps or giant steps. A Vertical scroll bar lets you move from the top to the bottom of the window; a Horizontal scroll bar lets you move between the left and right margins of the window. Use this Scroll bar when the contents of the window are too wide to fit on the screen. Figure 1.1 shows both Vertical and Horizontal scroll bars.

A scroll bar has two arrows at the end of a channel and sometimes contains a box called the Scroll box. The Scroll box is the key to moving rapidly; the arrows are the key to moving in smaller increments. Dragging the Scroll box enables you to quickly move long distances to an approximate location in your document. For example, if you drag the Scroll box to the middle of the channel, you'll scroll to approximately the middle of your document.

The Menu bar just below the Title bar is used to call up menus, or lists of tasks. Several of these tasks are described in this section.

Documents are created from the keyboard in much the same way they would be written with a typewriter. In computerese, writing a document is referred to as editing the document; therefore, Notepad is called a text editor.

After Notepad has been invoked, the following routine will introduce you to using Notepad:

1.

Click on the Work area of Notepad.

2.

Type a few words into Notepad.

3.

Press the Home key to move the cursor back to the beginning of the line. In general, the Home key moves the cursor to the beginning of the line on which it currently is located.

4.

Now press the End key. The cursor will move to the end of the line.

5.

Type some letters, and then press the Backspace key a few times. It will erase letters one at a time. Another method of deleting a letter is to move the cursor to that letter and press the Del key. (Del stands for "Delete.") The backspace key erases the character to the left of the cursor, and the Del key erases the character to the right of the cursor.

6.

Hold down the Ctrl key (Ctrl stands for "Control"), and press the Del key. This key combination (denoted Ctrl + Del) erases the portion of the line to the right of the cursor.

7.

Type more characters than can fit on one line of the screen. Notice that the leftmost characters scroll off the screen to make room for the new characters.

8.

Press and release Alt, then press and release O, and then press and release W. (This key combination is abbreviated Alt/Format/Word Wrap or Alt/O/W. The slash character (/), officially called a solidus, instructs you to release the character preceding it, before pressing the character following it.) Notice that Notepad divided the long line so that it fits in Notepad's window.

9.

Click Format on the Menu bar, and notice that there is a check mark in front of Word Wrap. To remove the check mark, turn the Word Wrap feature off by clicking once on Word Wrap.


[Page 9]

10.

The Enter key is used to begin a new line on the screen.

11.

The Alt key activates the Menu bar and causes a letter from each menu item to be underlined. Then, pressing one of the underlined letters, such as F, E, O, V, or H, selects a menu. (From the Menu bar, a menu also can be selected by pressing the right arrow key to highlight the name and then pressing the Enter key.) As shown in Figure 1.2, after a menu is opened, each option has one letter underlined. You can press an underlined letter to select an option. (Underlined letters are called access keys.) For instance, pressing A from the file menu selects the option "Save As". Selections also can be made with the cursor-movement keys and the Enter key.

Figure 1.2. A menu and its options.


Note 1: You can select menus and options without the use of keys by clicking on them with the mouse.

Note 2: You can close a menu, without making a selection, by clicking anywhere outside the menu or pressing the Esc key twice.

12.

The Esc key (Esc stands for "Escape") is used to return to the Work area.

13.

Press Alt/F/N. The dialog box in Figure 1.3 will appear and ask you if you want to save the current document. Decline by pressing N or clicking on the No button.

Figure 1.3. A "Do you want to save the changes?" dialog box.
(This item is displayed on page 10 in the print version)


14.

Type the following information into Notepad. (It gives the names of employees, their hourly wages, and the number of hours worked in the past week.) This document is used in Section 3.5

Mike Jones 7.35 35 John Smith 6.75 33



[Page 10]

15.

Store the document as a file on a disk. To save the document, press Alt/File/Save As. A dialog box appears, requesting a file name for the document. The cursor is in a narrow rectangular box labeled "File name:". Type a drive letter, a colon, a backslash (\), and a name, and then press the Enter key or click on Save. For instance, you might type C:\PAYROLL. The document will then be stored on drive C. This process is called saving the document. Notepad automatically adds a period and the extension txt to the name. Therefore, the complete file name is PAYROLL.TXT on the disk.

Note: If you want to save the document in a specific folder (directory) of the disk, include the folder's name. For instance, you might type C:\Myfiles\PAYROLL. See Section 1.3 for a discussion of folders.

16.

Press the key combination Alt/File/New to clear PAYROLL.TXT from Notepad.

17.

To restore PAYROLL.TXT as the document in Notepad, press Alt/File/Open, type something like C:\PAYROLL in the "File name:" box, and then press the Enter key.

18.

Move the cursor to the beginning of the document, and then press Alt/Edit/Find (or Ctrl + F) to invoke the Find dialog box. This dialog box contains several objects that will be discussed in this book. The text to be found should be typed into the rectangle containing the cursor. Such a rectangle is called a text box. The phrase "Find what:", which identifies the type of information that should be placed into the text box, is referred to as the text of a label.

19.

Type "smith" into the text box, and then click on the "Find Next" button. Clicking on it carries out a task. Text boxes, labels, and buttons are discussed in Section 3.2.

20.

The small square to the left of the words "Match case" is called a check box. Click on it to see it checked, and then click again to remove the check mark.

21.

The object captioned "Direction" is called a group box. It contains a pair of objects called radio buttons. Click on the "Up" radio button to select it, and then click on the "Down" radio button. Only one radio button at a time can be selected. Check boxes, group boxes, and radio buttons are discussed in Section 9.2.

22.

Press Alt/File/Exit to exit Notepad.

Comments

  1. Two useful key combinations that we have not discussed yet are the following:

    1. Ctrl + Home moves the cursor to the beginning of the document.

    2. Ctrl + End moves the cursor to the end of the document.


  2. [Page 11]
  3. Notepad can perform many of the tasks of word processors, such as search and block operations. However, these features needn't concern us presently. A discussion of them can be found in Appendix B, under "HOW TO: Use the Editor."

Practice Problems 1.2

(Solutions to practice problems always follow the exercises.) Assume that you are using Windows Notepad:

1.

Give two ways to open the Edit menu.

2.

Assume that the Edit menu has been opened. Give three ways to pick a menu item.

Exercises 1.2

1.

What does an hourglass pointer mean?

2.

Describe "clicking" in your own words.

3.

Describe "double-clicking" in your own words.

4.

Describe "dragging" in your own words.

5.

What is the blinking vertical line in Notepad called, and what is its purpose?

6.

How can you tell when a window is active?

7.

What is the difference between "Windows" and "windows?"

8.

What is the purpose of the vertical scroll bar in Notepad?

9.

By what name is a Notepad document known before it is named as part of being saved on disk?

In Exercises 10 through 24, give the key (or key combination) that performs the task in Windows Notepad.

10.

Remove a pull-down menu from the screen.

11.

Erase the character to the left of the cursor.

12.

Access the Start menu.

13.

Erase the character to the right of the cursor.

14.

Move the cursor to the beginning of the line containing the cursor.

15.

Move the cursor to the end of the line containing the cursor.

16.

Exit Notepad.

17.

Move the cursor to the beginning of the document.

18.

Move the cursor to the end of the document.

19.

Move from the Work area to the Menu bar.

20.

Move from the Menu bar to the Work area.

21.

Cancel a dialog box.

22.

Move from one option rectangle of a dialog box to another rectangle.

23.

Save the current document on a disk.

24.

Clear the current document from the Work area and start a new document.


[Page 12]
Solutions to Practice Problems 1.2

1.

Press Alt/Edit, or click on the word Edit in the toolbar to display the Edit menu. The jargon says the menu is "dropped down" or "pulled down."

2.

Press the down-arrow key to highlight the item, then press the Enter key. Or, press the underlined letter in the name of the item, or click on the item.




An Introduction to Programming Using Visual Basic 2005
Introduction to Programming Using Visual Basic 2005, An (6th Edition)
ISBN: 0130306541
EAN: 2147483647
Year: 2006
Pages: 164

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net