devxlogo

Tip Bank

Better Scrolling Images

I enjoyed Joel Paula’s “Scrollable Viewport for a Picture” tip [“101 Tech Tips for VB Developers,” Supplementto the February 1997 issue of VBPJ, page 12], and I’d like to make

Run Automation Manager as a Hidden Task

If you use OLE Remote Automation, you must start the Automation Manager on the server computer beforeany OLE remote communication occurs. By default, this application is visible, but you can

Problems with Popup Menus

If you use popup menus in your applications, you should be aware of a bug present in VB4 16/32 and VB5. Ifyou have two forms and the first one shows

Save Form Position and Size Using SaveSetting

SaveSetting and GetSetting make writing application settings a breeze. These two utility functions retrieve andstore the current forms position: Public Sub FormPosition_Get(F As Form)’ Retrieve Form F’s position from an

Properties that Behave Like Text and Caption

If you build an ActiveX control that exposes a Text- or Caption-like property, even under different names, you should modify its attributes in the Procedure Attribute dialog box after expanding

GoSubs are Slow in Compiled Programs

Because GoSubs make for less structured programming, many programmers avoid them. If you compile yourVB5 applications to native code, you have one more reason to stay away from them because,

Speed up your Code Using Choose

You can often use Choose to replace an array and build tables of results evaluated at compile-time instead ofrun time. For instance, if you need to evaluate the factorial of

Compact Your Code Using IIF and Switch

You can often replace an If…Then…Else block with a more compact IIf function: ‘ returns the max of two valuesmaxValue = IIf(first >= second, _ first, second) Switch is a