Category Archive for: Advanced ActiveX Controls

Using the TreeView Control

Let’s start our discussion with a few simple properties that you can see that design time through the control’s property pages. To experiment with the settings of the property pages, open the TView1 project in this chapter’s folder on the CO. The project’s main Form is shown. After setting Some properties (they are discussed next), run the project, and…

Read More →

Enumerating Nodes

Storing items in a TreeView control is one of the basic operations you can perform with the control. But how do you retrieve the nodes of the tree? The simplest method is to scan the Nodes collection, which contains all the nodes of the tree. The most appropriate loop for scanning a collection is the For Each ……

Read More →

Adding Node’s at Runtime

The Add Node button lets the user add new nodes to the tree at runtime. The number and type of the node(s) added depends on the contents of the TextBox controls: • If only the Textl control contains text, then a new continent will be added. • If the first two TextBox controls contain text, then:…

Read More →

Recursive Scanning

To start the scan of the TreeViewl control, start at the top node of the control with the statement: ScanNode TreeViewl.Nodes(1) The ScanNode() subroutine scans the nodes under the node that is passed as argument. By passing the root node to the ScanNode() subroutine, we’re in effect asking it to scan the entire tree. Let’s look now at the…

Read More →

Using Subltems

Each item in the ListView control may also have subitems. You can think of the item as the key of a record and the subitems as the other· fields of the record. The subitems are displayed only in the Report mode, but they are available to your code in any view. For example, you can display all items as icons,…

Read More →

Sorting and Searching

The ListView control provides the mechanisms for sorting its ms and searching for specific items, To sort the ListItems in the’ control, you. must assign the value True to the Sorted property. This is a Boolean value that determines whether the Listltems in the collectipn will be sorted. Two related properties a.rethe So~er . and SortKey properties.…

Read More →

The TreeView and ListView Controls

The last two ActiveX controls we’re going to explore in this chapter are among the more advanced ones, and they are certainly more difficult to program than the Previous ones. If you’re new to Visual Basic or programming, you may find this material over your head. You can safely skip the rest of this chapter and come…

Read More →

The Common Dialogs Control

A rather tedious, but quite common, task in nearly every application is to prompt the user for file names, font names and sizes, or colors to be used by the application. Designing your own dialog boxes for these Purposes would be a hassle, not to mention that your applications wouldn’t have the same look and feel of all…

Read More →

Advanced ActiveX Controls

In the first part of the book you learned how to use the basic ActiveX controls to build user interfaces. These controls appear on the Toolbox of the Visual Basic editor every time you start a new project, and they are the basic elements of the Windows interface. Windows applications also use other controls which aren’t displayed on the…

Read More →

Search and Replace Operations

The last option in the Edit menu -and the most interesting-displays a Search ‘& Replace dialog box (shown. in Figure 5.5). This dialog box wor ks like the Find and Replace dialog box of Word and many other Windows applications. The buttons in the Search & Replace dialog box are relatively self-explanatory: Find Locates the first…

Read More →

Back to Top