devxlogo

December 9, 2000

Quickly find which OptionButton is selected

Often OptionButton controls are arranged in control arrays. To quickly find the index of the only selected OptionButton control you can use the following code: ‘ assumes that the control

Use a ListBox as a poor man’s grid

You can easily create columns of data in a ListBox control by setting its tab stop at appropriate positions. This way, you can use a ListBox control as a sort

IsFormModal – Determines whether a form is modal

Private Declare Function GetWindowLong Lib “user32” Alias “GetWindowLongA” _ (ByVal hWnd As Long, ByVal nIndex As Long) As LongConst GWL_STYLE = (-16)Const WS_DISABLED = &H8000000′ Return True if the form

SetMenuBitmap – Add a bitmap to a menu item

Private Declare Function GetMenu Lib “user32” (ByVal hWnd As Long) As LongPrivate Declare Function GetSubMenu Lib “user32” (ByVal hMenu As Long, _ ByVal nPos As Long) As LongPrivate Declare Function

VB IDE and ObjectContext

A myth that is still being spread in various VB and MTS/COM+ related newsgroups, is that an application can not obtain a reference to the MTS or COM+ ObjectContext in