Using the IDE
What is the IDE?
Visual Basic Version: All
Issue: What is the IDE?
The IDE is the Visual Basic Integrated Development
Environment. It is where you design your forms and write your
code. When you launch Visual Basic, you are launching the IDE.
IDE Tips
Visual Basic Version: VB 5.0, VB 6.0
Issue: Give me some basic IDE tips!
Here are some general IDE tips:
- Use templates: You
can create templates for any type of module, forms,
classes, and so on. You can then save these to the
predefined templates directory. The template will then
automatically appear in the appropriate Add dialog box.
For example, your form templates will appear in the Add
Form dialog box. By using templates you can reuse a
dialog box look for every form in your project or reuse
standard properties and methods in every class.
- Use multiple tabs in the
toolbox: You can add tabs to your toolbox to
divide your controls into logical groupings. This makes
it easier to find and work with your controls, especially
if you have a lot of them in your toolbox.
- Use comment
block/uncomment block: These features allow you
to comment out large sections of code and later remove
the comments. This is useful when debugging sections of
code.
- Edit menu information in the
Properties window: You can now use the
Properties window to edit menu information instead of
opening the Menu editor. You still need to use the Menu
editor to create the menu originally, but then you can
update any menu information using the Properties window.
- Add your documentation to your
project: Use the Add File option in the Project
menu to add other files, such as documentation to your
project. You can then edit these files directly from the
IDE and save these associated files with the project.
- Use Option Explicit:
In Tools | Options, check "Require Variable
Declaration". This will cause "Option
Explicit" to be added to each new code module you
add to your project, including forms, classes, and any
other type of code module. With Option Explicit set, you
must declare your variables. This prevents variable
misspellings from causing logic errors in your
application.
- Turn off Auto Syntax Check:
In Tool | Options you can turn off Auto Syntax Check. VB
will still mark your edits with red if they are not
valid, but will not interrupt you with an irritating
message box every time you have a syntax error.
How do I close all windows for a
project?
Visual Basic Version: VB 5.0, VB 6.0
Issue: Now that I can work with multiple
projects in the IDE, the IDE can get messy. How can I close all
of the open designer and code windows for a project?
Simply click on the project in the Project window to contract
it and all of the associated project designer and code windows
will be closed.
How do I prevent Add-Ins from loading?
Visual Basic Version: VB 4.0 (16-bit and
32-bit), VB 5.0
Issue: When Visual Basic starts up, it
launches any active Add-Ins. If there is an error in one of the
Add-Ins, VB could GPF.
Here are the instructions for turning off Add-Ins before
launching Visual Basic.
1.Use a text editor such as Notepad.exe or WordPad.exe.
2.Edit the VBAddin.INI file in your Windows directory and set all
of the entries to zero (0). For example:
- Original: AppWizard.Wizard=1
- Modified: AppWizard.Wizard=0
3.Save VBAddin.INI.
4.Start Visual Basic.
If you want to turn off Add-Ins when you are already in Visual
Basic, use the Add-In Manager from the Add-Ins menu.