19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Private Sub cmdDisplay_Click()<br />

picFileSpec.Cls<br />

picFileSpec.Print dirList.Path;<br />

If Right(dirList.Path, 1) “\” Then<br />

picFileSpec.Print “\”;<br />

End If<br />

picFileSpec.Print filList.FileName<br />

End Sub<br />

Private Sub dirList_Change()<br />

filList.Path = dirList.Path<br />

End Sub<br />

Private Sub drvList_Change()<br />

dirList.Path = drvList.Drive<br />

End Sub<br />

[Run, select a drive, double-click on a directory, select a file, <strong>and</strong> then click the comm<strong>and</strong> button.]<br />

COMMENTS<br />

List Boxes <strong>and</strong> Combo Boxes 293<br />

1. If a list or combo box is too short to display all the items that have been added<br />

to it, <strong>Visual</strong> <strong>Basic</strong> automatically places a vertical scroll bar on the right side of<br />

the list box. The user can then scroll to see the remaining items of the list.<br />

2. When the Style property of a combo box is set to 2, the combo box becomes a<br />

dropdown list box. The Drive list box is an example of a dropdown list box.<br />

3. Dropdown combo boxes (Style 0) are used in Windows applications as a text<br />

box with a “history list” (list of past entries) from which you can either type a<br />

new entry or select an old entry.<br />

4. The st<strong>and</strong>ard Windows convention for opening a file is to double-click on a<br />

name in a file list box. The program must contain code for a DblClick event<br />

procedure to carry out this task.<br />

5. File list boxes can be made to display selective lists based on wildcard characters<br />

by setting the Pattern property. For instance, setting File1.Pattern equal to<br />

“*.TXT” dictates that only files with the extension TXT will be displayed.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!