- •Using UserForms
- •Creating UserForms
- •Adding and Manipulating Controls
- •Setting Properties
- •Types of Controls
- •The Label Control
- •The TextBox Control
- •The ComboBox Control
- •The ListBox Control
- •The CheckBox Control
- •The OptionButton Control
- •The ToggleButton Control
- •The Frame Control
- •The CommandButton Control
- •The TabStrip Control
- •The MultiPage Control
- •The ScrollBar Control
- •The SpinButton Control
- •The Image Control
- •Controls in the Sample Application
- •Naming Controls
- •UserForm Events
- •Your First Event Procedure
- •Useful Events
- •Events in the Sample Application
- •Working with Forms in AutoCAD
- •Launching a Form
- •Filling a ListBox
- •Selecting a Line
- •The Call Stack
- •The Locals Window
- •Finishing Touches
- •Automatically Loading a VBA Project
- •Automatically Running a VBA Procedure
- •Protecting Your VBA Code
- •Importing and Exporting Components
36 |
CHAPTER NINETY-NINE • USING VBA TO CREATE AUTOCAD APPLICATIONS |
To exit break mode, press the F5 key. This restarts your code running normally again.
The Call Stack
If your application is complex, it may be difficult to keep track of the flow of program control while you’re debugging. You can use the Call Stack to show which code is running at any given time. The Call Stack is a separate window in the VBA editor. You can open this window by selecting View Call Stack or using the Ctrl+L keyboard shortcut. Figure 99.27 shows the VBA Call Stack in action.
Figure 99.27 The Call Stack
This particular Call Stack shows that you’re currently debugging the cmdSelectLine_Click code, and that it was ultimately launched with the ModifyLines procedure. The <Non-Basic Code> in the middle indicates that the display of the form was handled by AutoCAD, and that you can’t debug that portion of the process.
The Locals Window
Another useful debugging tool is the Locals window, which can be opened with ViewLocals Window. This window provides a way to explore all of the variables that are currently in scope—that is, all of the variables that are visible to the current procedure. Figure 99.28 shows the Locals window.
Copyright ©2001 SYBEX, Inc., Alameda, CA |
www.sybex.com |