<html><head><title>Program Examples for Controls in the Dialog Editor</title><meta name="filename" content="text/sbasic/guide/sample_code"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
table.Tabelle1{
}
span.Tabelle1A{
width:2.461cm;}
span.Tabelle1B{
width:15.538cm;}
td.Tabelle1A1{
}
p.P1{
}
p.P2{
}
span.T1{
font-weight:bold;}
span.fr1{
}
</style></head><body>
<p class="P1"/>
<p class="Head1"><help:key-word value="program examples for controls; dialog editor" tag="kw68535_1" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="sample_code" xmlns:help="http://openoffice.org/2000/help"><help:link Id="68535">Program Examples for Controls in the Dialog Editor</help:link></help:to-be-embedded></p>
<p class="Paragraph">For these examples, create a new <help:link Id="68530" xmlns:help="http://openoffice.org/2000/help">dialog</help:link> with the name <span class="T1">Dialog1</span>. In the dialog editor, create the following controls: a <span class="T1">check box</span> with the name <span class="T1">CheckBox1</span>, a <span class="T1">label field</span> with the name <span class="T1">Label1</span>, a <span class="T1">button</span> with the name <span class="T1">CommandButton1</span>, and a <span class="T1">list box</span> with the name <span class="T1">ListBox1</span>.</p>
<p class="TextInTable">Use consistent writing (upper/lower case) when you attach a control to an object variable.</p>
</span></th></tr></table>
<p class="Head3"><a name="dialogload"/><help:key-word value="example; load a dialog" tag="kw68535_6" xmlns:help="http://openoffice.org/2000/help"/>Global Function for Loading Dialogs</p>
<p class="PropText">Function LoadDialog(Libname as String, DialogName as String, Optional oLibContainer)</p>
<p class="PropText">Dim oLib as Object</p>
<p class="PropText">Dim oLibDialog as Object</p>
<p class="PropText">Dim oRuntimeDialog as Object</p>
<p class="Head3"><help:key-word value="example; read or edit properties of controls" tag="kw68535_4" xmlns:help="http://openoffice.org/2000/help"/>Read or Edit Properties of Controls in the Program</p>
<p class="Head3"><help:key-word value="example; add entry to ListBox" tag="kw68535_3" xmlns:help="http://openoffice.org/2000/help"/>Add an Entry to a ListBox</p>
<p class="Head3"><help:key-word value="example; remove entry from ListBox" tag="kw68535_2" xmlns:help="http://openoffice.org/2000/help"/>Remove an Entry from a ListBox</p>