====== Form ======
{{page>commctrl}}
{|class="cboxtable"
|-
|class="cboxcell1"|{{ control_form.gif |}}
|class="cboxcell2"|**TAForm**
|}
A form is created by doing File -> New and selecting a template from the [[dialog_templates_gallery]] dialog or by clicking on the **New form** toolbar button.
\\
#remarks_header[Properties:]#
|**Caption**|Text that appears in the title bar. Can contain [[koda:documentation:appendice_faq|% variables]]. |
|**ClientHeight**|{{KODA>VAR>ClientHeight}} |
|**ClientWidth**|{{KODA>VAR>ClientWidth}} |
|**Color**|Background color|
|**ContextMenu**|Specifies [[control_contextmenu|context menu]] to attach to form. [[koda:documentation:create_menu|Create the ContextMenu control]] first |
|**Cursor**|Cursor shape to display when mouse is not over a control that has a shape specified |
|**Description**|{{KODA>VAR>Description}} |
|**Enabled**|False generates GUISetState(@SW_DISABLE)|
|**Font**|{{KODA>VAR>Font}} |
|**Left,Top**|Position of the form, in pixels: see Position |
|**Width,Height**|Size of form, in pixels |
|**Hint**|Text that appears when mouse hovers over form. Overridden by Hints for controls |
|**Icon**|{{KODA>VAR>Icon_Form}} |
|**Menu**|{{KODA>VAR>Menu}} |
|**Name**|Name of form and of the variable that is assigned its window handle in generated code. If not specified, no variable is generated |
|**OnClose**\\ **OnMaximize**\\ **OnMinimize**\\ **OnRestore**|For each of these events Koda generates (in Message Loop mode) a Case or (in OnEvent mode) a call to GUISetOnEvent and a skeleton event function. Double-click to right to open [[koda:documentation:proped_events_editor|]] |
|**ParentForm**|{{KODA>VAR>ParentForm}} |
|**Position**|{{KODA>VAR>Position_Form}} |
|**Resizing**|{{KODA>VAR>Resizing}} |
|**TrayMenu**|{{KODA>VAR>TrayMenu}} |
|**Visible**|False hides the form |
#remarks_header[Styles:]#
^ Constant ^ Description ^ Comments ^
|WS_MAXIMIZEBOX|Form has a maximize box | |
|WS_MINIMIZEBOX|Form has a minimize box | |
|WS_SIZEBOX|Form has a re-sizing border |Same as WS_THICKFRAME|
|WS_SYSMENU|Form has system menu on title bar|Requires WS_CAPTION|
|WS_DLGFRAME|Form has double border but no titlebar| |
|WS_CAPTION|Form has title bar |Includes WS_BORDER|
|WS_OVERLAPPEDWINDOW|Form is window with WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, WS_MAXIMIZEBOX |Same as WS_TILEDWINDOW |
|WS_MAXIMIZE|Form is initially maximized| |
|WS_CLIPCHILDREN|Excludes area occupied by child windows when drawing occurs within the parent window |Used when creating the parent window| |
|WS_MINIMIZE|Form is initially minimized | |
|WS_CHILD|Form is a child window|cannot have menu bar. Cannot be used with WS_POPUP |
|WS_POPUP|Creates a pop-up window |Cannot be used with WS_CHILD|
|WS_POPUPWINDOW|Form is window with WS_BORDER, WS_POPUP, WS_SYSMENU |To make menu visible, check WS_CAPTION |
|$WS_OVERLAPPED|Form has title bar and border |Same as WS_TILED |
|WS_HSCROLL|Form has horizontal scroll bar | |
|WS_VSCROLL|Form has vertical scroll bar| |
|WS_BORDER|Form has a thin-line border | |
|WS_CLIPSIBLINGS|If form overlaps another, this form shows fully | |
|DS_MODALFRAME|Form is dialog box with modal frame |Check WS_CAPTION for title bar, WS_SYSMENU for system menu |
#remarks_header[Extended Styles:]#
|WS_EX_ACCEPTFILES|Form accepts file names into Edit and Input controls via drag-and-drop ((WS_EX_ACCEPTFILES: To enable for an Edit or Input control, also check GUI_DROPACCEPTED in its styles)) |
|WS_EX_MDICHILD|Form is one of several that can be worked on simultaneously -- like MDI |
|WS_EX_APPWINDOW|When the Form is visible, force it onto taskbar |
|WS_EX_CONTEXTHELP|Puts **?** in title bar. Cannot use with WS_MAXIMIZEBOX and WS_MINIMIZEBOX. Same as WS_CONTEXTHELP |
|WS_LEFTSCROLLBAR|For right-to-left languages, moves vertical scroll bar (if any) to the left |
|WS_EX_OVERLAPPEDWINDOW| Form has raised edges and sunken client area |
|WS_EX_RIGHT|For right-to-left languages, text in Form and controls flows right to left |
|WS_EX_TOOLWINDOW|Form is a toolbar, intended to be floating ((WS_EX_TOOLWINDOW: A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font.)) |
|WS_EX_TOPMOST|Form is always on top |
|WS_EX_TRANSPARENT|Form appears to be transparent because underlying sibling windows are painted before this Form |
|WS_EX_WINDOWEDGE|Form has raised edges |
|WS_EX_LAYERED|Form is layered window. Cannot be used for child windows |
|WS_EX_COMPOSITED|Form is painted using double buffering, reducing flicker |
#remarks_header[Remarks:]#
None
#remarks_header[Related:]#
None