<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Fcontrol_element_forms</id>
	<title>EN/documentation/basic guide/control element forms - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Fcontrol_element_forms"/>
	<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/control_element_forms&amp;action=history"/>
	<updated>2026-11-11T13:54:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/control_element_forms&amp;diff=16887&amp;oldid=prev</id>
		<title>Sancho: Основной текст</title>
		<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/control_element_forms&amp;diff=16887&amp;oldid=prev"/>
		<updated>2011-09-06T17:04:54Z</updated>

		<summary type="html">&lt;p&gt;Основной текст&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;section begin=title /&amp;gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:&amp;lt;/noinclude&amp;gt;Control Element Forms in Detail&amp;lt;noinclude&amp;gt;}}&amp;lt;/noinclude&amp;gt;&amp;lt;section end=title /&amp;gt;{{BreadCrumbL10n}}&lt;br /&gt;
&lt;br /&gt;
{{Documentation/BASICGuideTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|ShowPrevPage=block&lt;br /&gt;
|PrevPage=EN/documentation/basic_guide/working_with_forms&lt;br /&gt;
|NextPage=EN/documentation/basic_guide/database_forms&lt;br /&gt;
|form=block&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
&lt;br /&gt;
The control elements available in forms are similar to those of dialogs. The selection ranges from simple text fields through list and combo boxes to various buttons.&lt;br /&gt;
&lt;br /&gt;
Below, you will find a list of the most important properties for control element forms. All properties form part of the associated model objects.&lt;br /&gt;
&lt;br /&gt;
In addition to the standard control elements, a table control element is also available for forms, which enables the complete incorporation of database tables.  This is described in the [[EN/documentation/basic_guide/database_forms|Database Forms]] chapter.&lt;br /&gt;
&lt;br /&gt;
== Buttons ==&lt;br /&gt;
&lt;br /&gt;
The model object of a form button provides the following properties:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;BackgroundColor (long)&amp;lt;/tt&amp;gt;:background color&lt;br /&gt;
;&amp;lt;tt&amp;gt;DefaultButton (Boolean)&amp;lt;/tt&amp;gt;:the button serves as a default value. In this case, it also responds to the entry button if it has no focus&lt;br /&gt;
;&amp;lt;tt&amp;gt;Enabled (Boolean)&amp;lt;/tt&amp;gt;:the control element can be activated&lt;br /&gt;
;&amp;lt;tt&amp;gt;Tabstop (Boolean)&amp;lt;/tt&amp;gt;:the control element can be reached through the tabulator button&lt;br /&gt;
;&amp;lt;tt&amp;gt;TabIndex (Long)&amp;lt;/tt&amp;gt;:position of control element in activation sequence&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontName (String)&amp;lt;/tt&amp;gt;:name of font type&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontHeight (Single)&amp;lt;/tt&amp;gt;:height of character in points (pt)&lt;br /&gt;
;&amp;lt;tt&amp;gt;Tag (String)&amp;lt;/tt&amp;gt;:string containing additional information, which can be saved in the button for program-controlled access&lt;br /&gt;
;&amp;lt;tt&amp;gt;TargetURL (String)&amp;lt;/tt&amp;gt;:target URL for buttons of the URL type&lt;br /&gt;
;&amp;lt;tt&amp;gt;TargetFrame (String)&amp;lt;/tt&amp;gt;:name of window (or frame) in which &amp;lt;tt&amp;gt;TargetURL&amp;lt;/tt&amp;gt; is to be opened when activating the button (for buttons of the &amp;lt;tt&amp;gt;URL&amp;lt;/tt&amp;gt; type)&lt;br /&gt;
;&amp;lt;tt&amp;gt;Label (String)&amp;lt;/tt&amp;gt;:button label&lt;br /&gt;
;&amp;lt;tt&amp;gt;TextColor (Long)&amp;lt;/tt&amp;gt;:text color of control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;HelpText (String)&amp;lt;/tt&amp;gt;:automatically displayed help text which is displayed if the mouse cursor is above the control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;HelpURL (String)&amp;lt;/tt&amp;gt;:URL of online help for the corresponding control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;ButtonType (Enum)&amp;lt;/tt&amp;gt;:action that is linked with the button (default value from &amp;lt;idl&amp;gt;com.sun.star.form.FormButtonType&amp;lt;/idl&amp;gt;)&lt;br /&gt;
;&amp;lt;tt&amp;gt;State (Short)&amp;lt;/tt&amp;gt;:in toggle button, 1 = pushed, 0 = normal&lt;br /&gt;
&lt;br /&gt;
Through the &amp;lt;tt&amp;gt;ButtonType&amp;lt;/tt&amp;gt; property, you have the opportunity to define an action that is automatically performed when the button is pressed. The associated &amp;lt;idl&amp;gt;com.sun.star.form.FormButtonType&amp;lt;/idl&amp;gt; group of constants provides the following values:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;PUSH&amp;lt;/tt&amp;gt;:standard button&lt;br /&gt;
;&amp;lt;tt&amp;gt;SUBMIT&amp;lt;/tt&amp;gt;:end of form entry (particularly relevant for HTML forms)&lt;br /&gt;
;&amp;lt;tt&amp;gt;RESET&amp;lt;/tt&amp;gt;:resets all values within the form to their original values&lt;br /&gt;
;&amp;lt;tt&amp;gt;URL&amp;lt;/tt&amp;gt;:call of the URL defined in &amp;lt;tt&amp;gt;TargetURL&amp;lt;/tt&amp;gt; (is opened within the window which was specified through &amp;lt;tt&amp;gt;TargetFrame&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
The '''OK''' and '''Cancel''' button types provided in dialogs are not supported in forms.&lt;br /&gt;
&lt;br /&gt;
== Option Buttons ==&lt;br /&gt;
&lt;br /&gt;
The following properties of an option button are available through its model object:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;Enabled (Boolean)&amp;lt;/tt&amp;gt;:the control element can be activated&lt;br /&gt;
;&amp;lt;tt&amp;gt;Tabstop (Boolean)&amp;lt;/tt&amp;gt;:the control element can be reached through the tab key&lt;br /&gt;
;&amp;lt;tt&amp;gt;TabIndex (Long)&amp;lt;/tt&amp;gt;:position of control element in the activation sequence&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontName (String)&amp;lt;/tt&amp;gt;:name of font type&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontHeight (Single)&amp;lt;/tt&amp;gt;:height of character in points (pt)&lt;br /&gt;
;&amp;lt;tt&amp;gt;Tag (String)&amp;lt;/tt&amp;gt;:string containing additional information, which can be saved in the button for program-controlled access&lt;br /&gt;
;&amp;lt;tt&amp;gt;Label (String)&amp;lt;/tt&amp;gt;:inscription of button&lt;br /&gt;
;&amp;lt;tt&amp;gt;Printable (Boolean)&amp;lt;/tt&amp;gt;:the control element can be printed&lt;br /&gt;
;&amp;lt;tt&amp;gt;State (Short)&amp;lt;/tt&amp;gt;:if 1, the option is activated, otherwise it is deactivated&lt;br /&gt;
;&amp;lt;tt&amp;gt;RefValue (String)&amp;lt;/tt&amp;gt;:string for saving additional information (for example, for administering data record IDs)&lt;br /&gt;
;&amp;lt;tt&amp;gt;TextColor (Long)&amp;lt;/tt&amp;gt;:text color of control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;HelpText (String)&amp;lt;/tt&amp;gt;:automatically displayed help text, which is displayed if the mouse cursor is above the control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;HelpURL (String)&amp;lt;/tt&amp;gt;:URL of online help for the corresponding control element&lt;br /&gt;
&lt;br /&gt;
The mechanism for grouping option buttons distinguishes between the control elements for dialogs and forms. Whereas control elements appearing one after another in dialogs are automatically combined to form a group, grouping in forms is performed on the basis of names. To do this, all option buttons of a group must contain the same name. {{OOo}} combines the grouped control elements into an array so that the individual buttons of a {{OOo}} Basic program can be reached in the same way.&lt;br /&gt;
&lt;br /&gt;
The following example shows how the models of the control elements of a group can be iterated, exemplary displaying the states of all control elements in a given group:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Function test&lt;br /&gt;
  Dim oGroup as object&lt;br /&gt;
  Dim Doc As Object&lt;br /&gt;
  Dim Forms As Object&lt;br /&gt;
  Dim Form As Object&lt;br /&gt;
  Dim Ctl As Object&lt;br /&gt;
  Dim I as Integer&lt;br /&gt;
 &lt;br /&gt;
  Doc = ThisComponent&lt;br /&gt;
  Forms = Doc.Drawpage.Forms&lt;br /&gt;
 &lt;br /&gt;
  Form = Forms.GetbyIndex(0)&lt;br /&gt;
&lt;br /&gt;
  oForm.getGroupByName(&amp;quot;MyOptions&amp;quot;, oGroup)&lt;br /&gt;
  msg = &amp;quot;&amp;quot;&lt;br /&gt;
  for i = LBound(oGroup) to UBound(oGroup)&lt;br /&gt;
    oCtl = oGroup(i)&lt;br /&gt;
    msg = msg + oCtl.Name + &amp;quot;: &amp;quot; + (str(oCtl.State)) + chr(10)&lt;br /&gt;
  next i&lt;br /&gt;
  MsgBox msg &lt;br /&gt;
&lt;br /&gt;
end Function  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code corresponds to the previous example for determining a simple control element model. It accesses the array of models using the &amp;lt;tt&amp;gt;GetGroupByName&amp;lt;/tt&amp;gt; method (rather than the &amp;lt;tt&amp;gt;GetByName&amp;lt;/tt&amp;gt; method to determine simple models).&lt;br /&gt;
&lt;br /&gt;
== Checkboxes ==&lt;br /&gt;
&lt;br /&gt;
The model object of a checkbox form provides the following properties: &lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;Enabled (Boolean)&amp;lt;/tt&amp;gt;:the control element can be activated&lt;br /&gt;
;&amp;lt;tt&amp;gt;Tabstop (Boolean)&amp;lt;/tt&amp;gt;:the control element can be reached through the tab key&lt;br /&gt;
;&amp;lt;tt&amp;gt;TabIndex (Long)&amp;lt;/tt&amp;gt;:position of control element in the activation sequence&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontName (String)&amp;lt;/tt&amp;gt;:name of font type&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontHeight (Single)&amp;lt;/tt&amp;gt;:height of character in points (pt)&lt;br /&gt;
;&amp;lt;tt&amp;gt;Tag (String)&amp;lt;/tt&amp;gt;:string containing additional information, which can be saved in the button for program-controlled access&lt;br /&gt;
;&amp;lt;tt&amp;gt;Label (String)&amp;lt;/tt&amp;gt;:button label&lt;br /&gt;
;&amp;lt;tt&amp;gt;Printable (Boolean)&amp;lt;/tt&amp;gt;:the control element can be printed&lt;br /&gt;
;&amp;lt;tt&amp;gt;State (Short)&amp;lt;/tt&amp;gt;:if 1, the option is activated, otherwise it is deactivated&lt;br /&gt;
;&amp;lt;tt&amp;gt;RefValue (String)&amp;lt;/tt&amp;gt;:string for saving additional information (for example, for administrating data record IDs)&lt;br /&gt;
;&amp;lt;tt&amp;gt;TextColor (Long)&amp;lt;/tt&amp;gt;:text color of control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;HelpText (String)&amp;lt;/tt&amp;gt;:automatically displayed help text, which is displayed if the mouse cursor is above the control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;HelpURL (String)&amp;lt;/tt&amp;gt;:URL of online help for the corresponding control element&lt;br /&gt;
&lt;br /&gt;
== Text Fields ==&lt;br /&gt;
&lt;br /&gt;
The model objects of text field forms offer the following properties:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;Align (short)&amp;lt;/tt&amp;gt;:orientation of text (0: left-aligned, 1: centered, 2: right-aligned)&lt;br /&gt;
;&amp;lt;tt&amp;gt;BackgroundColor (long)&amp;lt;/tt&amp;gt;:background color of control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;Border (short)&amp;lt;/tt&amp;gt;:type of border (0: no border, 1: 3D border, 2: simple border)&lt;br /&gt;
;&amp;lt;tt&amp;gt;EchoChar (String)&amp;lt;/tt&amp;gt;:echo character for password field&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontName (String)&amp;lt;/tt&amp;gt;:name of font type&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontHeight (Single)&amp;lt;/tt&amp;gt;:height of character in points (pt)&lt;br /&gt;
;&amp;lt;tt&amp;gt;HardLineBreaks (Boolean)&amp;lt;/tt&amp;gt;:the automatic line breaks are permanently inserted in the text of the control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;HScroll (Boolean)&amp;lt;/tt&amp;gt;:the text has a horizontal scrollbar&lt;br /&gt;
;&amp;lt;tt&amp;gt;MaxTextLen (Short)&amp;lt;/tt&amp;gt;:maximum length of text; if 0 is specified, there are no limits&lt;br /&gt;
;&amp;lt;tt&amp;gt;MultiLine (Boolean)&amp;lt;/tt&amp;gt;:permits multi-line entries&lt;br /&gt;
;&amp;lt;tt&amp;gt;Printable (Boolean)&amp;lt;/tt&amp;gt;:the control element can be printed&lt;br /&gt;
;&amp;lt;tt&amp;gt;ReadOnly (Boolean)&amp;lt;/tt&amp;gt;:the content of the control element is read-only&lt;br /&gt;
;&amp;lt;tt&amp;gt;Enabled (Boolean)&amp;lt;/tt&amp;gt;:the control element can be activated&lt;br /&gt;
;&amp;lt;tt&amp;gt;Tabstop (Boolean)&amp;lt;/tt&amp;gt;:the control element can be reached through the tab key&lt;br /&gt;
;&amp;lt;tt&amp;gt;TabIndex (Long)&amp;lt;/tt&amp;gt;:position of the control element in the activation sequence&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontName (String)&amp;lt;/tt&amp;gt;:name of font type&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontHeight (Single)&amp;lt;/tt&amp;gt;:height of character in points (pt)&lt;br /&gt;
;&amp;lt;tt&amp;gt;Text (String)&amp;lt;/tt&amp;gt;:text of control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;TextColor (Long)&amp;lt;/tt&amp;gt;:text color of control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;VScroll (Boolean)&amp;lt;/tt&amp;gt;:the text has a vertical scrollbar&lt;br /&gt;
;&amp;lt;tt&amp;gt;HelpText (String)&amp;lt;/tt&amp;gt;:automatically displayed help text, which is displayed if the mouse cursor is above the control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;HelpURL (String)&amp;lt;/tt&amp;gt;:URL of online help for the corresponding control element&lt;br /&gt;
&lt;br /&gt;
== List Boxes ==&lt;br /&gt;
&lt;br /&gt;
The model object of the list box forms provides the following properties:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;BackgroundColor (long)&amp;lt;/tt&amp;gt;:background color of control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;Border (short)&amp;lt;/tt&amp;gt;:type of border (0: no border, 1: 3D frame, 2: simple frame)&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontDescriptor (struct)&amp;lt;/tt&amp;gt;:structure with details of font to be used (in accordance with &amp;lt;idl&amp;gt;com.sun.star.awt.FontDescriptor&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;LineCount (Short)&amp;lt;/tt&amp;gt;:number of lines of control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;MultiSelection (Boolean)&amp;lt;/tt&amp;gt;:permits multiple selection of entries&lt;br /&gt;
;&amp;lt;tt&amp;gt;SelectedItems (Array of Strings)&amp;lt;/tt&amp;gt;:list of highlighted entries&lt;br /&gt;
;&amp;lt;tt&amp;gt;StringItemList (Array of Strings)&amp;lt;/tt&amp;gt;:list of all entries&lt;br /&gt;
;&amp;lt;tt&amp;gt;ValueItemList (Array of Variant)&amp;lt;/tt&amp;gt;:list containing additional information for each entry (for example, for administrating data record IDs)&lt;br /&gt;
;&amp;lt;tt&amp;gt;Printable (Boolean)&amp;lt;/tt&amp;gt;:the control element can be printed&lt;br /&gt;
;&amp;lt;tt&amp;gt;ReadOnly (Boolean)&amp;lt;/tt&amp;gt;:the content of the control element is read-only&lt;br /&gt;
;&amp;lt;tt&amp;gt;Enabled (Boolean)&amp;lt;/tt&amp;gt;:the control element can be activated&lt;br /&gt;
;&amp;lt;tt&amp;gt;Tabstop (Boolean)&amp;lt;/tt&amp;gt;:the control element can be reached through the tab key&lt;br /&gt;
;&amp;lt;tt&amp;gt;TabIndex (Long)&amp;lt;/tt&amp;gt;:position of control element in the activation sequence&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontName (String)&amp;lt;/tt&amp;gt;:name of font type&lt;br /&gt;
;&amp;lt;tt&amp;gt;FontHeight (Single)&amp;lt;/tt&amp;gt;:height of character in points (pt)&lt;br /&gt;
;&amp;lt;tt&amp;gt;Tag (String)&amp;lt;/tt&amp;gt;:string containing additional information which can be saved in the button for program-controlled access&lt;br /&gt;
;&amp;lt;tt&amp;gt;TextColor (Long)&amp;lt;/tt&amp;gt;:text color of control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;HelpText (String)&amp;lt;/tt&amp;gt;:automatically displayed help text, which is displayed if the mouse cursor is above the control element&lt;br /&gt;
;&amp;lt;tt&amp;gt;HelpURL (String)&amp;lt;/tt&amp;gt;:URL of online help for the corresponding control element&lt;br /&gt;
&lt;br /&gt;
{{VBAnote|Through their &amp;lt;tt&amp;gt;ValueItemList&amp;lt;/tt&amp;gt; property, list box forms provide a counterpart to the VBA property, &amp;lt;tt&amp;gt;ItemData&amp;lt;/tt&amp;gt;, through which you can administer additional information for individual list entries.}}&lt;br /&gt;
&lt;br /&gt;
Furthermore, the following methods are provided though the view object of the list box:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;addItem (Item, Pos)&amp;lt;/tt&amp;gt;:inserts the string specified in the &amp;lt;tt&amp;gt;Item&amp;lt;/tt&amp;gt; at the &amp;lt;tt&amp;gt;Pos&amp;lt;/tt&amp;gt; position in the list&lt;br /&gt;
;&amp;lt;tt&amp;gt;addItems (ItemArray, Pos)&amp;lt;/tt&amp;gt;:inserts the entries listed in the string's &amp;lt;tt&amp;gt;ItemArray&amp;lt;/tt&amp;gt; data field in the list at the &amp;lt;tt&amp;gt;Pos&amp;lt;/tt&amp;gt; position&lt;br /&gt;
;&amp;lt;tt&amp;gt;removeItems (Pos, Count)&amp;lt;/tt&amp;gt;:removes &amp;lt;tt&amp;gt;Count&amp;lt;/tt&amp;gt; entries as of the &amp;lt;tt&amp;gt;Pos&amp;lt;/tt&amp;gt; position&lt;br /&gt;
;&amp;lt;tt&amp;gt;selectItem (Item, SelectMode)&amp;lt;/tt&amp;gt;:activates or deactivates the highlighting for the element specified in the string &amp;lt;tt&amp;gt;Item&amp;lt;/tt&amp;gt; depending on the &amp;lt;tt&amp;gt;SelectMode&amp;lt;/tt&amp;gt; variable&lt;br /&gt;
;&amp;lt;tt&amp;gt;makeVisible (Pos)&amp;lt;/tt&amp;gt;:scrolls through the list field so that the entry specified by &amp;lt;tt&amp;gt;Pos&amp;lt;/tt&amp;gt; is visible&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;/div&gt;</summary>
		<author><name>Sancho</name></author>
		
	</entry>
</feed>