The SysInfo control lets you resize your forms to take any taskbar into account. For example, you might want to move and resize your form so it always appears at the bottom of the work area-that is, the area not taken by the Windows or Office taskbar or any other taskbar currently visible:
Private Sub Form_Load() MoveFormEnd Sub' this form is 1000 twips tall, and is located ' near the bottom border of the workareaSub MoveForm() With SysInfo1 Me.Move .WorkAreaLeft, _ .WorkAreaTop + .WorkAreaHeight _ - 1000, .WorkAreaWidth, 1000 End WithEnd Sub
To move and resize the form automatically when the user moves the taskbars, creates new taskbars, or hides them, you have to trap the SysInfo control’s SettingChanged event:
Private Sub SysInfo1_SettingChanged(ByVal Item As Integer) Const SPI_SETWORKAREA = 47 If Item = SPI_SETWORKAREA Then MoveForm End IfEnd Sub
For more information on this topic, look on VB’s Help file under “SysInfo.”