MaxButton, MinButton, HelpButton Property

Purpose

Sets the minimize, maximize and help button of a Form.

Syntax

Form.MaxButton [ = True | False ]

Form.MaxButton [ = True | False ]

Form.HelpButton [ = True | False ]

Description

When set to True the form has a Maximize or Minimize button (default).

A Maximize button enables users to enlarge a form window to full-screen size. To display a Maximize button, you must also set the form's BorderStyle property to either 1 (Fixed Single), 2 (Sizable), or 3 (Fixed Double).

The settings you specify for the MaxButton, MinButton, BorderStyle, and ControlBox properties are related with each other. When ControlBox = False the MinButton and MaxButton aren't visible.

HelpButton removes or sets the help button in the title bar of a Form. To get the What's This question mark button in the title bar of the window, the properties of both MinButton and MaxButton must be set to False. The OnCtrlHelp event occurs when the help button cursor is clicked on an Ocx control or F1 is pressed. Set the WhatsThisHelpID of a control to identify the help content.

Instead of using HelpButton, it is possible to create the same effectby using a pushbutton/command control which can toggle the window's WhatsThisMode.

Example

OpenW 1

Me.MinButton = 0

Me.MaxButton = 0

Me.HelpButton = True

Ocx Command cmd = "Show Max && Min buttons", 10, 40, 140, 24

cmd.WhatsThisHelpID = 1001

Do

Sleep

Until Me Is Nothing

 

Sub cmd_Click

Me.MaxButton = Not Me.MaxButton

Me.MinButton = Not Me.MinButton

cmd.Caption = (Me.MaxButton ? "Hide" : "Show") & " Max && Min buttons"

EndSub

 

Sub Win_1_OnCtrlHelp(Ctrl As Object, x%, y%)

Trace Ctrl.WhatsThisHelpID

EndSub

Remarks

See Also

Form

{Created by Sjouke Hamstra; Last updated: 15/10/2014 by James Gaite}