|
Add comments to End If and Loop statements
|
Total Hit (2429) |
Here's a little programming tip that will save you hours of headaches later.
Most of us already indent our Ifs, Selects, Do...Loops, etc., and that is good. But suppose you have some fairly complex code with several levels of indentation. Example:
«Code LangId=1»
If A= 0 and B=1 then
'
....Read More |
Rating
|
|
|
Convert a VB6 project back to VB5
|
Total Hit (2406) |
If you load a VB6 project file in the VB5 environment you get a warning, even though the project is correctly loaded. The cause of the warning is a VB6 attribute "Retained" (that is, the "Retained in memory" option in the Project Properties dialog box) that isn't recognized by VB5. If you want to ma
....Read More |
Rating
|
|
|
Copying menu controls from one form to another
|
Total Hit (2754) |
If you're building a project with multiple similar forms, it's nice to be able to cut-and-paste controls from one form to another. However, in VB6, you can't do this for menu controls - unless you get tricky. The trick is to make an end-run around the VB IDE. Warning: don't try this unless you have
....Read More |
Rating
|
|
|
Fast Copy of Properties between Controls
|
Total Hit (2409) |
You probably already know that if you select multiple controls on a form you can use the Property Window to change one of their common property in one single operation. However, here is a trick that is likely to be ignored by most programmer (included me, until recently).
If you want to copy a n
....Read More |
Rating
|
|
|
Logging under a different name makes your add-ins disappear
|
Total Hit (2206) |
After you install Visual Basic and log on to the machine as a different user (with or without administrator privileges), you cannot see any Add-Ins in the Add-In dialog in Visual Basic.
I ran across this problem when I logged in and installed VB6 on NT Workstation under my User, for a developer
....Read More |
Rating
|
|
|
Multiple compilation constants
|
Total Hit (2282) |
Visual Basic's documentation does not explain how to specify more than just one conditional compilation constant in the Advanced tab of the Options dialog. The correct way is using a colon as a delimiter, as in:
demo = -1: version = 100
Note that you can only assign integer numeric values, an
....Read More |
Rating
|
|
|
Quick Property Edits
|
Total Hit (2213) |
When you are placing controls on a form at design time and wish to edit one of its properties, the quickest way to switch to the Property window is pressing the Ctrl+Shift+key combination, where key is the first letter in the property name. For instance, to quickly modify the Caption property you si
....Read More |
Rating
|
|
|
Quickly copy field attributes when creating tables
|
Total Hit (3050) |
Under VB6 you can create new SQL Server and Oracle tables - but not MDB tables - without leaving the environment. You only have open the DataView window, right-click on the Tables folder of a database, and select the New Table mennu command.
When working with similar tables, that is tables with m
....Read More |
Rating
|
|
|
Start the IDE with maximized code and form windows
|
Total Hit (2270) |
The VB IDE remembers most of the configuration settings that were active when you closed the previous session. However, the maximized status of child MDI windows (the code editor and the designer window) isn't remembered, and the IDE always starts with non-maximized windows. To have VB always start
....Read More |
Rating
|
|
|
Determine whether the IDE is in design, break, or run mode
|
Total Hit (2256) |
The VBIDE object model doesn't offer any native property or method to determine whether the IDE is in design-time mode, run-time mode, or debug (break) mode. However, it's easy to deduct this information by looking at the Enabled property of the menu commands in the Run top-level menu:
«Code Lang
....Read More |
Rating
|
|
|
Saving and restoring all IDE settings
|
Total Hit (2348) |
At times you'd like to save all the current settings of the Visual Basic environment and restore them afterwards. For example, you may want to alternate between the MDI environment with the code editor using Courier New 12 and the SDI environment with Arial 14. Or you may want to dock a different se
....Read More |
Rating
|
|
|
How to handle the Mouse Wheel events in your projects (improved)
|
Total Hit (3172) |
API Declarations
«Code LangId=1»
'==============inside a MODULE
Option Explicit
'************************************************************
'API
'************************************************************
Private Declare Function CallWindowProc Lib "user32.dll" Alias "CallWindowProcA"
....Read More |
Rating
|
|
|
RunTime Debug Tracing
|
Total Hit (2023) |
Sometimes you want to be able to view trace messages when running your application outside the VB IDE. Perhaps something slightly different happens as an Executable; or you may be running something that's not so easy to debug, such as subclasses, callback procedures and custom COM implementations. W
....Read More |
Rating
|
|