devxlogo

Tip Bank

The fmod() Function

The modulus operator can only be applied to integral types. To compute the remainder of two floating point variables, you have to use the fmod() function instead. Fmod() is declared

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

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