<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"  xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:access="http://www.bloglines.com/about/specs/fac-1.0">
  <access:restriction relationship="allow" />
  <channel>
    <title>Wikispaces : Liberty BASIC Programmer&#039;s Encyc - items matching description</title>
    <link>https://lbpe.wikispaces.com/space/view</link>
    <description>Filtered items at Wikispaces : Liberty BASIC Programmer&#039;s Encyc</description>
    
    <webMaster>help@wikispaces.com (Wikispaces)</webMaster>
    <generator>https://www.wikispaces.com/</generator>
    <ttl>60</ttl>
    <atom:link href="https://lbpe.wikispaces.com/space/xmlo?v=rss_2_0" rel="self" type="application/rss+xml" />
    <image>
      <title>Wikispaces : Liberty BASIC Programmer&#039;s Encyc - items matching description</title>
      <url>https://www.wikispaces.com/i/l.png</url>
      <link>https://lbpe.wikispaces.com/space/view</link>
      <width>140</width>
      <height>48</height>
      <description>Wikispaces</description>
    </image>

    <item>
      <title>BmpButtons</title>
      <link>https://lbpe.wikispaces.com/BmpButtons</link>
      <dc:creator>Alyce</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/BmpButtons</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/BmpButtons</comments>
      <pubDate>Thu, 26 Jul 2012 10:30:13 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:6:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;BmpButtons&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:6 --&gt;BmpButtons&lt;/h1&gt;
&lt;!-- ws:start:WikiTextUserlinkRule:06:[[user:Alyce]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/Alyce-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Alyce&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;Alyce&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:06 --&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextTocRule:22:&amp;lt;img id=&amp;quot;wikitext@@toc@@flat&amp;quot; class=&amp;quot;WikiMedia WikiMediaTocFlat&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/flat?w=100&amp;amp;h=16&amp;quot;/&amp;gt; --&gt;&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;!-- ws:start:WikiTextTocRule:23: --&gt;&lt;a href=&quot;#BmpButtons&quot;&gt;BmpButtons&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt; | &lt;a href=&quot;#What are BmpButtons?&quot;&gt;What are BmpButtons?&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt; | &lt;a href=&quot;#How Do BmpButtons Work?&quot;&gt;How Do BmpButtons Work?&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt; | &lt;a href=&quot;#BmpButton Commands&quot;&gt;BmpButton Commands&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt; | &lt;a href=&quot;#SETTING FOCUS TO A BMPBUTTON&quot;&gt;SETTING FOCUS TO A BMPBUTTON&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt; | &lt;a href=&quot;#CHANGING THE BITMAP ON THE BUTTON&quot;&gt;CHANGING THE BITMAP ON THE BUTTON&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt; | &lt;a href=&quot;#MOVING AND RESIZING A BMPBUTTON&quot;&gt;MOVING AND RESIZING A BMPBUTTON&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt; | &lt;a href=&quot;#DEMO&quot;&gt;DEMO&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;hr /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:8:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;What are BmpButtons?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:8 --&gt;What are BmpButtons?&lt;/h1&gt;
&lt;br /&gt;
BmpButtons are buttons that display an image instead of text. The button on the left is a BmpButton. The button on the right is a regular push button.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:60:&amp;lt;img src=&amp;quot;/file/view/bmpbutton.jpg/238005303/bmpbutton.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/bmpbutton.jpg/238005303/bmpbutton.jpg&quot; alt=&quot;bmpbutton.jpg&quot; title=&quot;bmpbutton.jpg&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:60 --&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:10:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;How Do BmpButtons Work?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:10 --&gt;How Do BmpButtons Work?&lt;/h1&gt;
&lt;br /&gt;
Bmpbuttons work a little differently than regular buttons. Instead of a caption, we must specify a filename for the bitmap that will appear on the button. This filename can have a relative path. If we run a program in the Liberty BASIC directory, it can find the bmps in the bmp directory if we specify the path like this:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;bmpbutton #1.b, &amp;amp;quot;bmp\copy.bmp&amp;amp;quot;,[hi],UL,10,10&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;bmpbutton&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.b&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;bmp\copy.bmp&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;hi&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
The bmpbutton command also includes the name of the branch label or sub that will be the event handler for the button, the corner to which placement will be relative, and the x and y placement coordinates. We can&#039;t specify a width and height as we can with regular push buttons, because Liberty BASIC checks the size of the bitmap and makes the button that same size.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:12:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;BmpButton Commands&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:12 --&gt;BmpButton Commands&lt;/h1&gt;
&lt;br /&gt;
Bmpbuttons understand a limited command set.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;print #handle.ext, &amp;quot;bitmap bitmapname&amp;quot;&lt;/li&gt;&lt;li&gt;print #handle.ext, &amp;quot;locate x y width height&amp;quot;&lt;/li&gt;&lt;li&gt;print #handle.ext, &amp;quot;setfocus&amp;quot;&lt;/li&gt;&lt;li&gt;print #handle.ext, &amp;quot;enable&amp;quot;&lt;/li&gt;&lt;li&gt;print #handle.ext, &amp;quot;disable&amp;quot;&lt;/li&gt;&lt;li&gt;print #handle.ext, &amp;quot;show&amp;quot;&lt;/li&gt;&lt;li&gt;print #handle.ext, &amp;quot;hide&amp;quot;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:14:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;SETTING FOCUS TO A BMPBUTTON&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:14 --&gt;SETTING FOCUS TO A BMPBUTTON&lt;/h1&gt;
&lt;br /&gt;
Commands sent to a bmpbutton should not begin with a &amp;quot;!&amp;quot; character like commands sent to a regular button. We cannot change the text on a bmpbutton, because there IS no text on a bmpbutton. We can cause a bmpbutton to receive the input focus so that any keypresses will be directed to the bmpbutton. Here is the syntax:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;print #handle.ext, &amp;amp;quot;setfocus&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;handle.ext&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;setfocus&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:16:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;CHANGING THE BITMAP ON THE BUTTON&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:16 --&gt;CHANGING THE BITMAP ON THE BUTTON&lt;/h1&gt;
&lt;br /&gt;
We can set the bitmap of the control to be the named bitmap that has been loaded previously with the LOADBMP command (not the filename of the bitmap).&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;loadbmp &amp;amp;quot;bitmapname&amp;amp;quot;, &amp;amp;quot;filename.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;print #handle.ext, &amp;amp;quot;bitmap bitmapname&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;loadbmp&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;bitmapname&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;filename.bmp&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;handle.ext&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;bitmap bitmapname&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;br /&gt;
If the new bitmap is not the same dimensions as the original bitmap, it won&#039;t look right, because the bmpbutton will not automatically change size to match the new bitmap. You can find the dimensions of a bitmap by loading it into MS Paint and checking its attributes. You can also find the dimensions of a loaded bitmap at runtime by opening the file and reading the info, or via API calls.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:18:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;MOVING AND RESIZING A BMPBUTTON&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:18 --&gt;MOVING AND RESIZING A BMPBUTTON&lt;/h1&gt;
&lt;br /&gt;
You can reposition the bmpbutton within the window that contains it. Use the &amp;quot;locate&amp;quot; command. This command requires the new x and y coordinates for the bmpbutton, plus the width and height desired. You must issue a &amp;quot;refresh&amp;quot; command to the window to cause it to update the display to show the new location of the button. To use the &amp;quot;locate&amp;quot; command, you must know the desired dimensions of the bmpbutton. See Issue #100 for a way to discover bitmap dimensions at runtime. Here is the syntax:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;print #handle.ext, &amp;amp;quot;locate x y width height&amp;amp;quot;&amp;lt;br/&amp;gt;print #handle, &amp;amp;quot;refresh&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;handle.ext&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;locate x y width height&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;handle&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;refresh&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;br /&gt;
Remember that values inside the quotes are hard-coded. To use variables, place them outside of the quote marks and preserve the blank spaces inside the quote marks.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;print #handle.ext, &amp;amp;quot;locate 12 45 25 25&amp;amp;quot;&amp;lt;br/&amp;gt;or&amp;lt;br/&amp;gt;x=12 : y=45 : width=25 : height=25&amp;lt;br/&amp;gt;print #handle.ext, &amp;amp;quot;locate &amp;amp;quot;;x;&amp;amp;quot; &amp;amp;quot;;y;&amp;amp;quot; &amp;amp;quot;;width;&amp;amp;quot; &amp;amp;quot;;height&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;handle.ext&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;locate 12 45 25 25&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;or&lt;/span&gt;
x&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; y&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;45&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; width&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; height&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;handle.ext&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;locate &amp;quot;&lt;/span&gt;;x;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;y;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;width;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;height&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;br /&gt;
The &amp;quot;locate&amp;quot; command gives us the ability to specify a width and height for our bmpbuttons, so we are not limited to accepting the size given them by Liberty BASIC. We can change the look of our buttons this way, making them smaller if the window is resized by the user to be very small, for instance. We can also use the &amp;quot;bitmap&amp;quot; command to place a new image on the button, and then use the &amp;quot;locate&amp;quot; command to change the size of the button to match the size of the new bitmap.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:20:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;DEMO&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:20 --&gt;DEMO&lt;/h1&gt;
&lt;br /&gt;
Here is a small demo that illustrates some of the possibilities of using the &amp;quot;bitmap&amp;quot; and &amp;quot;locate&amp;quot; commands with bmpbuttons.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;&#039;run this code from within your Liberty BASIC directory&amp;lt;br/&amp;gt;&#039;so that the bmps can be found by the program&amp;lt;br/&amp;gt;nomainwin&amp;lt;br/&amp;gt;WindowWidth=600:WindowHeight=400&amp;lt;br/&amp;gt;bmpbutton #1.b, &amp;amp;quot;bmp\copy.bmp&amp;amp;quot;,[hi],UL,10,10&amp;lt;br/&amp;gt;button #1.move, &amp;amp;quot;Move Button&amp;amp;quot;,[moveButton],UL,10,80,140,24&amp;lt;br/&amp;gt;button #1.new, &amp;amp;quot;New Bitmap&amp;amp;quot;,[new],UL,10,120,140,24&amp;lt;br/&amp;gt;open &amp;amp;quot;Move Bmpbutton&amp;amp;quot; for window as #1&amp;lt;br/&amp;gt;#1 &amp;amp;quot;trapclose [quit]&amp;amp;quot;&amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[quit]&amp;lt;br/&amp;gt;&#039;if bmp was loaded, unload it&amp;lt;br/&amp;gt;if pianoLoaded then unloadbmp &amp;amp;quot;piano&amp;amp;quot;&amp;lt;br/&amp;gt;close #1:end&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[moveButton]&amp;lt;br/&amp;gt;&#039;move bmpbutton to new coords&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;if not(pianoLoaded) then&amp;lt;br/&amp;gt;&#039;actual size of copy bmp is&amp;lt;br/&amp;gt;&#039;25x25, and we will preserve that:&amp;lt;br/&amp;gt;#1.b &amp;amp;quot;locate 200 10 25 25&amp;amp;quot;&amp;lt;br/&amp;gt;else&amp;lt;br/&amp;gt;&#039;if piano bmp is in use, use&amp;lt;br/&amp;gt;&#039;these dimensions:&amp;lt;br/&amp;gt;#1.b, &amp;amp;quot;locate 200 10 300 50&amp;amp;quot;&amp;lt;br/&amp;gt;end if&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;#1 &amp;amp;quot;refresh&amp;amp;quot;&amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[new]&amp;lt;br/&amp;gt;&#039;change bmp and reposition&amp;lt;br/&amp;gt;loadbmp &amp;amp;quot;piano&amp;amp;quot;,&amp;amp;quot;bmp\piano6.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;pianoLoaded=1   &#039;flag that bmp was loaded&amp;lt;br/&amp;gt;&#039;actual size of piano.bmp is 600x100&amp;lt;br/&amp;gt;&#039;but we will make it 300x50 here:&amp;lt;br/&amp;gt;#1.b &amp;amp;quot;bitmap piano&amp;amp;quot;&amp;lt;br/&amp;gt;#1.b &amp;amp;quot;locate 50 10 300 50&amp;amp;quot;&amp;lt;br/&amp;gt;#1 &amp;amp;quot;refresh&amp;amp;quot;&amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[hi]&amp;lt;br/&amp;gt;notice &amp;amp;quot;Hi&amp;amp;quot;&amp;lt;br/&amp;gt;wait&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039;run this code from within your Liberty BASIC directory&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;so that the bmps can be found by the program&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;nomainwin&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;600&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;400&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;bmpbutton&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.b&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;bmp\copy.bmp&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;hi&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.move&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Move Button&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;moveButton&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;140&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.new&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;New Bitmap&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;new&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;140&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Move Bmpbutton&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;trapclose [quit]&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;quit&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;if bmp was loaded, unload it&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; pianoLoaded &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;unloadbmp&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;piano&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;close&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;end&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;moveButton&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;move bmpbutton to new coords&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;not&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;pianoLoaded&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;actual size of copy bmp is&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;25x25, and we will preserve that:&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.b &lt;span class=&quot;st0&quot;&gt;&amp;quot;locate 200 10 25 25&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;if piano bmp is in use, use&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;these dimensions:&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.b&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;locate 200 10 300 50&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;refresh&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;new&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;change bmp and reposition&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;loadbmp&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;piano&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;bmp\piano6.bmp&amp;quot;&lt;/span&gt;
pianoLoaded&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;&#039;flag that bmp was loaded&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;actual size of piano.bmp is 600x100&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;but we will make it 300x50 here:&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.b &lt;span class=&quot;st0&quot;&gt;&amp;quot;bitmap piano&amp;quot;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.b &lt;span class=&quot;st0&quot;&gt;&amp;quot;locate 50 10 300 50&amp;quot;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;refresh&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;hi&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;notice&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Hi&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;hr /&gt;
&lt;!-- ws:start:WikiTextTocRule:32:&amp;lt;img id=&amp;quot;wikitext@@toc@@flat&amp;quot; class=&amp;quot;WikiMedia WikiMediaTocFlat&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/flat?w=100&amp;amp;h=16&amp;quot;/&amp;gt; --&gt;&lt;!-- ws:end:WikiTextTocRule:32 --&gt;&lt;!-- ws:start:WikiTextTocRule:33: --&gt;&lt;a href=&quot;#BmpButtons&quot;&gt;BmpButtons&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:33 --&gt;&lt;!-- ws:start:WikiTextTocRule:34: --&gt; | &lt;a href=&quot;#What are BmpButtons?&quot;&gt;What are BmpButtons?&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:34 --&gt;&lt;!-- ws:start:WikiTextTocRule:35: --&gt; | &lt;a href=&quot;#How Do BmpButtons Work?&quot;&gt;How Do BmpButtons Work?&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:35 --&gt;&lt;!-- ws:start:WikiTextTocRule:36: --&gt; | &lt;a href=&quot;#BmpButton Commands&quot;&gt;BmpButton Commands&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:36 --&gt;&lt;!-- ws:start:WikiTextTocRule:37: --&gt; | &lt;a href=&quot;#SETTING FOCUS TO A BMPBUTTON&quot;&gt;SETTING FOCUS TO A BMPBUTTON&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:37 --&gt;&lt;!-- ws:start:WikiTextTocRule:38: --&gt; | &lt;a href=&quot;#CHANGING THE BITMAP ON THE BUTTON&quot;&gt;CHANGING THE BITMAP ON THE BUTTON&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:38 --&gt;&lt;!-- ws:start:WikiTextTocRule:39: --&gt; | &lt;a href=&quot;#MOVING AND RESIZING A BMPBUTTON&quot;&gt;MOVING AND RESIZING A BMPBUTTON&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:39 --&gt;&lt;!-- ws:start:WikiTextTocRule:40: --&gt; | &lt;a href=&quot;#DEMO&quot;&gt;DEMO&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:40 --&gt;&lt;!-- ws:start:WikiTextTocRule:41: --&gt;
&lt;!-- ws:end:WikiTextTocRule:41 --&gt;</description>
          </item>
    <item>
      <title>ccbCode</title>
      <link>https://lbpe.wikispaces.com/ccbCode</link>
      <dc:creator>Alyce</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/ccbCode</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/ccbCode</comments>
      <pubDate>Wed, 08 Apr 2009 13:24:16 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextAnchorRule:11:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@a&amp;quot; title=&amp;quot;Anchor: a&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;a&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:11 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;freebasic&amp;quot;&amp;gt;&#039;Make a custom control hyperlink with a Liberty BASIC graphicbox.&amp;lt;br/&amp;gt;&#039;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-&#039;&amp;lt;br/&amp;gt; [SetupWindow]&amp;lt;br/&amp;gt; NoMainWin&amp;lt;br/&amp;gt; WindowWidth = 400&amp;lt;br/&amp;gt; WindowHeight = 200&amp;lt;br/&amp;gt; UpperLeftX = Int((DisplayWidth-WindowWidth)/2)&amp;lt;br/&amp;gt; UpperLeftY = Int((DisplayHeight-WindowHeight)/2)&amp;lt;br/&amp;gt; Link1.Width = 80&amp;lt;br/&amp;gt; Link1.Height = 26&amp;lt;br/&amp;gt; GraphicBox #Win.Link1, 4, 4, Link.Width, Link.Height&amp;lt;br/&amp;gt; Stylebits #Win.Link1, 0, _WS_BORDER, 0, 0&amp;lt;br/&amp;gt; Open &amp;amp;quot;Hyperlink Custom Control&amp;amp;quot; For Window As #Win&amp;lt;br/&amp;gt; #Win, &amp;amp;quot;TrapClose [Quit.Win]&amp;amp;quot;&amp;lt;br/&amp;gt; Wait&amp;lt;br/&amp;gt; [Quit.Win]&amp;lt;br/&amp;gt; Close #Win&amp;lt;br/&amp;gt; End&amp;lt;br/&amp;gt; [Link1.Click]&amp;lt;br/&amp;gt; Wait&amp;lt;br/&amp;gt; [Link1.Move]&amp;lt;br/&amp;gt; Wait&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.freebasic  {font-family:monospace;}
.freebasic .imp {font-weight: bold; color: red;}
.freebasic .kw1 {color: #b1b100;}
.freebasic .co1 {color: #808080;}
.freebasic .co2 {color: #339933;}
.freebasic .es0 {color: #000099;}
.freebasic .br0 {color: #66cc66;}
.freebasic .sy0 {color: #66cc66;}
.freebasic .st0 {color: #ff0000;}
.freebasic .nu0 {color: #cc66cc;}
.freebasic .me0 {color: #66cc66;}
.freebasic span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;freebasic&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Make a custom control hyperlink with a Liberty BASIC graphicbox.&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;-----------------------------------------------------------------&#039;&lt;/span&gt;
 &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;SetupWindow&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
 NoMainWin
 WindowWidth = &lt;span class=&quot;nu0&quot;&gt;400&lt;/span&gt;
 WindowHeight = &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;
 UpperLeftX = &lt;span class=&quot;kw1&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayWidth-WindowWidth&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;/&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
 UpperLeftY = &lt;span class=&quot;kw1&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayHeight-WindowHeight&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;/&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
 Link1.&lt;span class=&quot;kw1&quot;&gt;Width&lt;/span&gt; = &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;
 Link1.&lt;span class=&quot;me1&quot;&gt;Height&lt;/span&gt; = &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;
 GraphicBox &lt;span class=&quot;co2&quot;&gt;#Win.Link1, 4, 4, Link.Width, Link.Height&lt;/span&gt;
 Stylebits &lt;span class=&quot;co2&quot;&gt;#Win.Link1, 0, _WS_BORDER, 0, 0&lt;/span&gt;
 &lt;span class=&quot;kw1&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Hyperlink Custom Control&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;#Win&lt;/span&gt;
 &lt;span class=&quot;co2&quot;&gt;#Win, &amp;quot;TrapClose [Quit.Win]&amp;quot;&lt;/span&gt;
 &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
 &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Quit.&lt;span class=&quot;me1&quot;&gt;Win&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
 &lt;span class=&quot;kw1&quot;&gt;Close&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;#Win&lt;/span&gt;
 &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
 &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Link1.&lt;span class=&quot;me1&quot;&gt;Click&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
 &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
 &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Link1.&lt;span class=&quot;me1&quot;&gt;Move&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
 &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:12:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@b&amp;quot; title=&amp;quot;Anchor: b&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;b&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:12 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;freebasic&amp;quot;&amp;gt;    [SetupWindow]&amp;lt;br/&amp;gt;        NoMainWin&amp;lt;br/&amp;gt;        WindowWidth = 400&amp;lt;br/&amp;gt;        WindowHeight = 200&amp;lt;br/&amp;gt;        UpperLeftX = Int((DisplayWidth-WindowWidth)/2)&amp;lt;br/&amp;gt;        UpperLeftY = Int((DisplayHeight-WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        Link1.Width = 80&amp;lt;br/&amp;gt;        Link1.Height = 26&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        GraphicBox #Win.Link1, 4, 4, Link1.Width, Link1.Height&amp;lt;br/&amp;gt;        Stylebits #Win.Link1, 0, _WS_BORDER, 0, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        Open &amp;amp;quot;Hyperlink Custom Control&amp;amp;quot; For Window As #Win&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        #Win, &amp;amp;quot;TrapClose [Quit.Win]&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;                Link1$ = cCc.Hyperlink$(&amp;amp;quot;#Win.Link1&amp;amp;quot;, Link1.Width, Link1.Height, &amp;amp;quot;Link 1 Text&amp;amp;quot;, _&amp;lt;br/&amp;gt;        &amp;amp;quot;Arial 10&amp;amp;quot;, &amp;amp;quot;buttonface&amp;amp;quot;, &amp;amp;quot;blue&amp;amp;quot;, &amp;amp;quot;[Link1.Click]&amp;amp;quot;, &amp;amp;quot;[Link1.Move]&amp;amp;quot;)&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    [Quit.Win]&amp;lt;br/&amp;gt;        Close #Win&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    [Link1.Click]&amp;lt;br/&amp;gt;        Notice &amp;amp;quot;You clicked Link 1.&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    [Link1.Move]&amp;lt;br/&amp;gt;        Call cC.RollHyperlink Link1$, MouseX, MouseY&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Function cCc.Hyperlink$(gbHndl$, width, height, text$, font$, backcolor$, linkcolor$, eventClick$, eventMove$)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;CLS; Down; Fill &amp;amp;quot;;backcolor$ &#039;Clear the graphicbox and fill it with the specified backcolor.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;We need the height of the current font in pixels. Here&#039;s an easy way:&amp;lt;br/&amp;gt;            #gbHndl$, &amp;amp;quot;Place -100 -100 &amp;amp;quot; &#039;Place pen offscreen&amp;lt;br/&amp;gt;            #gbHndl$, &amp;amp;quot;| &amp;amp;quot; &#039;Print a blank line.&amp;lt;br/&amp;gt;            #gbHndl$, &amp;amp;quot;PosXY penX penY&amp;amp;quot; &#039;Get the coordinates of the pen. After drawing text, the pen moves down the proper&amp;lt;br/&amp;gt;                &#039;height to make room for another line. Just subtract the end position from the start position to get the height&amp;lt;br/&amp;gt;                &#039;of the font:&amp;lt;br/&amp;gt;            fontHeight = penY-(-100) &#039;And it works, if you print the results out!&amp;lt;br/&amp;gt;        &#039;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-&#039;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;CLS; Down; Fill &amp;amp;quot;;backcolor$;&amp;amp;quot;; Flush&amp;amp;quot; &#039;Redo the intial thing just in case and this time flush it&amp;lt;br/&amp;gt;            &#039;so the graphics will stick.&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Font &amp;amp;quot;;font$;&amp;amp;quot; ; Color &amp;amp;quot;;linkcolor$;&amp;amp;quot; ; BackColor &amp;amp;quot;;backcolor$ &#039;Set the font, foreground and background&amp;lt;br/&amp;gt;            &#039;color.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;While we&#039;re at it, let&#039;s get the width of the string (so we can center our text in the graphicbox!):&amp;lt;br/&amp;gt;            #gbHndl$, &amp;amp;quot;StringWidth? text$ stringWidth&amp;amp;quot;&amp;lt;br/&amp;gt;            &#039;Calculate the x coordinate for text placement:&amp;lt;br/&amp;gt;            Xcoord = Int((width-stringWidth)/2)&amp;lt;br/&amp;gt;        &#039;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-&#039;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Place &amp;amp;quot;;Xcoord;&amp;amp;quot; &amp;amp;quot;;fontHeight+2 &#039;Set the pen at the proper location so the text will draw correctly&amp;lt;br/&amp;gt;            &#039;in the graphicbox.&amp;lt;br/&amp;gt;            &#039;Notice the text will start at the far left of the gbox, just like statictext would.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;|&amp;amp;quot;; text$ &#039;Draw the text!&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Flush DefaultText&amp;amp;quot; &#039;Make this drawing stick. And, give this drawing (segment) the name DefaultText .&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;when leftButtonUp &amp;amp;quot;; eventClick$ &#039;Set the graphicbox to jump to the branch label/sub that the user&amp;lt;br/&amp;gt;            &#039;specified when the link/graphicbox is clicked.&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;when mouseMove &amp;amp;quot;; eventMove$&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;Now, return the handle to a hyperlink so the user can pass it to the hyperlink functions:&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        hlinkActive = 0 &#039;The hyperlink isn&#039;t active just yet.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;Return all the info as one big string of data seperated by spaces. We&#039;ll parse this using word$() in another&amp;lt;br/&amp;gt;        &#039;function. This allows the user to have more or less a &amp;amp;quot;handle&amp;amp;quot; to a link.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        font$ = Sys.ReplaceChar$(font$,&amp;amp;quot; &amp;amp;quot;,&amp;amp;quot;ø&amp;amp;quot;) &#039;Replace any spaces in the font text with a weird symbol, so we can parse the&amp;lt;br/&amp;gt;            &#039;handle with word$() in another function.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        text$ = Sys.ReplaceChar$(text$,&amp;amp;quot; &amp;amp;quot;,&amp;amp;quot;ø&amp;amp;quot;) &#039;Do the same with the text of the hyperlink. We&#039;ll reverse this in the other&amp;lt;br/&amp;gt;            &#039;function using Sys.ReplaceChar$(text$,&amp;amp;quot;_&amp;amp;quot;,&amp;amp;quot; &amp;amp;quot;) which will replace the underscores with spaces - so we&#039;ll be back&amp;lt;br/&amp;gt;            &#039;to normal. Same with the font$.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        cCc.Hyperlink$=gbHndl$;&amp;amp;quot; &amp;amp;quot;;width;&amp;amp;quot; &amp;amp;quot;;height;&amp;amp;quot; &amp;amp;quot;;hlinkActive;&amp;amp;quot; &amp;amp;quot;;font$;&amp;amp;quot; &amp;amp;quot;;backcolor$;&amp;amp;quot; &amp;amp;quot;;linkcolor$;&amp;amp;quot; &amp;amp;quot;;_&amp;lt;br/&amp;gt;        eventClick$;&amp;amp;quot; &amp;amp;quot;;eventMove$;&amp;amp;quot; &amp;amp;quot;;text$;&amp;amp;quot; &amp;amp;quot;;fontHeight&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;Word 1 = handle to the graphicbox.&amp;lt;br/&amp;gt;        &#039;Word 2 = the width of the graphicbox&amp;lt;br/&amp;gt;        &#039;Word 3 = the height of the graphicbox.&amp;lt;br/&amp;gt;        &#039;Word 4 = 0/1 - whether or not the link is active (mouse over) hlinkActive&amp;lt;br/&amp;gt;        &#039;Word 5 = the font used&amp;lt;br/&amp;gt;        &#039;Word 6 = the backcolor&amp;lt;br/&amp;gt;        &#039;Word 7 = the link color&amp;lt;br/&amp;gt;        &#039;Word 8 = the event in which to trigger when the link is clicked.&amp;lt;br/&amp;gt;        &#039;Word 9 = the event in which to trigger when the mouse is moved over the gbox.&amp;lt;br/&amp;gt;        &#039;Word 10 = the text for the hyperlink&amp;lt;br/&amp;gt;        &#039;Word 11 = the height of the font&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    End Function&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub cC.RollHyperlink byref Link$, X, Y&amp;lt;br/&amp;gt;        &#039;Extract information from the hyperlink&#039;s handle:&amp;lt;br/&amp;gt;        gbHndl$ = Word$(Link$,1) : width = Val(Word$(Link$,2)) : height = Val(Word$(Link$,3))&amp;lt;br/&amp;gt;        hlinkActive = Val(Word$(Link$,4)) : font$ = Word$(Link$,5) : backcolor$ = Word$(Link$,6)&amp;lt;br/&amp;gt;        linkcolor$ = Word$(Link$,7) : eventClick$ = Word$(Link$,8) : eventMove$ = Word$(Link$,9)&amp;lt;br/&amp;gt;        text$ = Word$(Link$,10) : fontHeight = Val(Word$(Link$,11))&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Font &amp;amp;quot;;font$;&amp;amp;quot; ; Color &amp;amp;quot;;linkcolor$;&amp;amp;quot; ; BackColor &amp;amp;quot;;backcolor$ &#039;Make sure the colors and fonts are set&amp;lt;br/&amp;gt;            &#039;right...&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;Now, replace the weird symbol in the font$ and text$ with spaces:&amp;lt;br/&amp;gt;        font$ = Sys.ReplaceChar$(font$,&amp;amp;quot;ø&amp;amp;quot;,&amp;amp;quot; &amp;amp;quot;)&amp;lt;br/&amp;gt;        text$ = Sys.ReplaceChar$(text$,&amp;amp;quot;ø&amp;amp;quot;,&amp;amp;quot; &amp;amp;quot;)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;Recalculate the width of the text for placement&#039;s sake:&amp;lt;br/&amp;gt;            #gbHndl$, &amp;amp;quot;StringWidth? text$ stringWidth&amp;amp;quot;&amp;lt;br/&amp;gt;            &#039;Calculate the x coordinate for text placement:&amp;lt;br/&amp;gt;            Xcoord = Int((width-stringWidth)/2)&amp;lt;br/&amp;gt;        &#039;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-&#039;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;Check to see if the mouse coordinates (X, Y) are over the link&#039;s text - if so, we&#039;ll make sure the hyperlink&amp;lt;br/&amp;gt;        &#039;becomes underlined:&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;First, let&#039;s get the width of the hyperlink&#039;s text using the stringwidth? command:&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;StringWidth? text$ textWidth&amp;amp;quot;&amp;lt;br/&amp;gt;        textWidth = textWidth + 1&amp;lt;br/&amp;gt;            &#039;Now, we know both the width and height of the text. they are stored in textWidth and fontHeight . Perfect!&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;Now, check to see if the mouse is over the actual area the text is drawn in:&amp;lt;br/&amp;gt;            If X&amp;amp;lt;=(textWidth+Xcoord) And X&amp;amp;gt;=Xcoord And Y&amp;amp;lt;=(fontHeight+2) And Y&amp;amp;gt;=2 Then &#039;If the mouse is in the proper area:&amp;lt;br/&amp;gt;                If Not(hlinkActive) Then&amp;lt;br/&amp;gt;                    &#039;If the link has not been drawn in it&#039;s mouseOver (active) state, then let&#039;s do so now.&amp;lt;br/&amp;gt;                    &#039;If hlinkActive was true (set to 1),&amp;lt;br/&amp;gt;                    &#039;it means we had already drawn it in it&#039;s active state, so we wouldn&#039;t need to redraw the same thing.&amp;lt;br/&amp;gt;                    &#039;That just causes flickering.&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;DELSEGMENT DefaultText&amp;amp;quot; &#039;Delete the inactive (normal) drawing of the text.&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;REDRAW&amp;amp;quot; &#039;Update the graphicbox to reflect our deletion.&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;Place &amp;amp;quot;;Xcoord;&amp;amp;quot; &amp;amp;quot;;fontHeight+2 &#039;Position the pen to redraw the text.&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;Font &amp;amp;quot;;font$;&amp;amp;quot; underscore&amp;amp;quot; &#039;Set the font to be underlined! Of course,&amp;lt;br/&amp;gt;                        &#039;if the user already has an underlined font, this is a bummer. :(&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;|&amp;amp;quot;;text$ &#039;Draw the new, underlined text!&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;Flush ActiveText&amp;amp;quot; &#039;Make this drawing stick, and call it ActiveText -&amp;lt;br/&amp;gt;                              &#039;we can remove this drawing and redraw the old one when the mouse isn&#039;t&amp;lt;br/&amp;gt;                        &#039;over the graphicbox text area. Cool, huh?&amp;lt;br/&amp;gt;                    hlinkActive = 1 &#039;The hyperlink is now in it&#039;s active state!&amp;lt;br/&amp;gt;                End If&amp;lt;br/&amp;gt;            Else &#039;If the mouse is NOT over the actual text area, then let&#039;s make sure that the hyperlink is drawn in it&#039;s&amp;lt;br/&amp;gt;                 &#039;inactive state.&amp;lt;br/&amp;gt;                If hlinkActive Then &#039;If the hyperlink is being drawn in it&#039;s active state, then let&#039;s unactivate it!&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;DELSEGMENT ActiveText&amp;amp;quot; &#039;Remove the drawing of the active text.&amp;lt;br/&amp;gt;                    &#039;Draw the text in it&#039;s normal state:&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;REDRAW&amp;amp;quot;&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;Font &amp;amp;quot;;font$&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;Place &amp;amp;quot;;Xcoord;&amp;amp;quot; &amp;amp;quot;;fontHeight+2&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;|&amp;amp;quot;;text$&amp;lt;br/&amp;gt;                    #gbHndl$, &amp;amp;quot;Flush DefaultText&amp;amp;quot; &#039;Make it stick and call this drawing the DefaultText drawing.&amp;lt;br/&amp;gt;                    hlinkActive = 0 &#039;hlinkActive is now inactive.&amp;lt;br/&amp;gt;                End If&amp;lt;br/&amp;gt;            End If&amp;lt;br/&amp;gt;        &#039;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-&#039;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;Replace spaces with underscores...&amp;lt;br/&amp;gt;        font$ = Sys.ReplaceChar$(font$,&amp;amp;quot; &amp;amp;quot;,&amp;amp;quot;ø&amp;amp;quot;)&amp;lt;br/&amp;gt;        text$ = Sys.ReplaceChar$(text$,&amp;amp;quot; &amp;amp;quot;,&amp;amp;quot;ø&amp;amp;quot;)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        &#039;Change the properties of the hyperlink&#039;s handle to match the updated properties.&amp;lt;br/&amp;gt;        &#039;This will actually affect the user&#039;s handle, because we passed Link$ by reference. (byref in the help file)&amp;lt;br/&amp;gt;        Link$=gbHndl$;&amp;amp;quot; &amp;amp;quot;;width;&amp;amp;quot; &amp;amp;quot;;height;&amp;amp;quot; &amp;amp;quot;;hlinkActive;&amp;amp;quot; &amp;amp;quot;;font$;&amp;amp;quot; &amp;amp;quot;;backcolor$;&amp;amp;quot; &amp;amp;quot;;linkcolor$;&amp;amp;quot; &amp;amp;quot;;_&amp;lt;br/&amp;gt;        eventClick$;&amp;amp;quot; &amp;amp;quot;;eventMove$;&amp;amp;quot; &amp;amp;quot;;text$;&amp;amp;quot; &amp;amp;quot;;fontHeight&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    &#039;This is a helper function for the hyperlink functions.&amp;lt;br/&amp;gt;    Function Sys.ReplaceChar$(String$, FindChar$, ReplaceChar$) &#039;Find the character FindChar$ and replace&amp;lt;br/&amp;gt;        &#039;it with ReplaceChar$&amp;lt;br/&amp;gt;        For i = 1 To Len(String$)&amp;lt;br/&amp;gt;            char$=Mid$(String$,i,1)&amp;lt;br/&amp;gt;            If char$=FindChar$ Then char$=ReplaceChar$&amp;lt;br/&amp;gt;            Sys.ReplaceChar$=Sys.ReplaceChar$;char$&amp;lt;br/&amp;gt;        Next i&amp;lt;br/&amp;gt;    End Function&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.freebasic  {font-family:monospace;}
.freebasic .imp {font-weight: bold; color: red;}
.freebasic .kw1 {color: #b1b100;}
.freebasic .co1 {color: #808080;}
.freebasic .co2 {color: #339933;}
.freebasic .es0 {color: #000099;}
.freebasic .br0 {color: #66cc66;}
.freebasic .sy0 {color: #66cc66;}
.freebasic .st0 {color: #ff0000;}
.freebasic .nu0 {color: #cc66cc;}
.freebasic .me0 {color: #66cc66;}
.freebasic span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;freebasic&quot;&gt;    &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;SetupWindow&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
        NoMainWin
        WindowWidth = &lt;span class=&quot;nu0&quot;&gt;400&lt;/span&gt;
        WindowHeight = &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;
        UpperLeftX = &lt;span class=&quot;kw1&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayWidth-WindowWidth&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;/&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        UpperLeftY = &lt;span class=&quot;kw1&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayHeight-WindowHeight&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;/&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
        Link1.&lt;span class=&quot;kw1&quot;&gt;Width&lt;/span&gt; = &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;
        Link1.&lt;span class=&quot;me1&quot;&gt;Height&lt;/span&gt; = &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;
&amp;nbsp;
        GraphicBox &lt;span class=&quot;co2&quot;&gt;#Win.Link1, 4, 4, Link1.Width, Link1.Height&lt;/span&gt;
        Stylebits &lt;span class=&quot;co2&quot;&gt;#Win.Link1, 0, _WS_BORDER, 0, 0&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;kw1&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Hyperlink Custom Control&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;#Win&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co2&quot;&gt;#Win, &amp;quot;TrapClose [Quit.Win]&amp;quot;&lt;/span&gt;
&amp;nbsp;
                Link1$ = cCc.&lt;span class=&quot;me1&quot;&gt;Hyperlink&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;#Win.Link1&amp;quot;&lt;/span&gt;, Link1.&lt;span class=&quot;kw1&quot;&gt;Width&lt;/span&gt;, Link1.&lt;span class=&quot;me1&quot;&gt;Height&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Link 1 Text&amp;quot;&lt;/span&gt;, _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;Arial 10&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonface&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;blue&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;[Link1.Click]&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;[Link1.Move]&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Quit.&lt;span class=&quot;me1&quot;&gt;Win&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;Close&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;#Win&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Link1.&lt;span class=&quot;me1&quot;&gt;Click&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
        Notice &lt;span class=&quot;st0&quot;&gt;&amp;quot;You clicked Link 1.&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Link1.&lt;span class=&quot;me1&quot;&gt;Move&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; cC.&lt;span class=&quot;me1&quot;&gt;RollHyperlink&lt;/span&gt; Link1$, MouseX, MouseY
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; cCc.&lt;span class=&quot;me1&quot;&gt;Hyperlink&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gbHndl$, &lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;, height, text$, font$, backcolor$, linkcolor$, eventClick$, eventMove$&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;CLS; Down; Fill &amp;quot;;backcolor$ &#039;Clear the graphicbox and fill it with the specified backcolor.&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;We need the height of the current font in pixels. Here&#039;s an easy way:&lt;/span&gt;
            &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Place -100 -100 &amp;quot; &#039;Place pen offscreen&lt;/span&gt;
            &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;| &amp;quot; &#039;Print a blank line.&lt;/span&gt;
            &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;PosXY penX penY&amp;quot; &#039;Get the coordinates of the pen. After drawing text, the pen moves down the proper&lt;/span&gt;
                &lt;span class=&quot;co1&quot;&gt;&#039;height to make room for another line. Just subtract the end position from the start position to get the height&lt;/span&gt;
                &lt;span class=&quot;co1&quot;&gt;&#039;of the font:&lt;/span&gt;
            fontHeight = penY-&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;And it works, if you print the results out!&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;--------------------------------------------------------------------&#039;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;CLS; Down; Fill &amp;quot;;backcolor$;&amp;quot;; Flush&amp;quot; &#039;Redo the intial thing just in case and this time flush it&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;so the graphics will stick.&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Font &amp;quot;;font$;&amp;quot; ; Color &amp;quot;;linkcolor$;&amp;quot; ; BackColor &amp;quot;;backcolor$ &#039;Set the font, foreground and background&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;color.&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;While we&#039;re at it, let&#039;s get the width of the string (so we can center our text in the graphicbox!):&lt;/span&gt;
            &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;StringWidth? text$ stringWidth&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;Calculate the x coordinate for text placement:&lt;/span&gt;
            Xcoord = &lt;span class=&quot;kw1&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;width-stringWidth&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;/&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;--------------------------------------------------------------------&#039;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Place &amp;quot;;Xcoord;&amp;quot; &amp;quot;;fontHeight+2 &#039;Set the pen at the proper location so the text will draw correctly&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;in the graphicbox.&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;Notice the text will start at the far left of the gbox, just like statictext would.&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;|&amp;quot;; text$ &#039;Draw the text!&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Flush DefaultText&amp;quot; &#039;Make this drawing stick. And, give this drawing (segment) the name DefaultText .&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;when leftButtonUp &amp;quot;; eventClick$ &#039;Set the graphicbox to jump to the branch label/sub that the user&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;specified when the link/graphicbox is clicked.&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;when mouseMove &amp;quot;; eventMove$&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;Now, return the handle to a hyperlink so the user can pass it to the hyperlink functions:&lt;/span&gt;
&amp;nbsp;
        hlinkActive = &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;The hyperlink isn&#039;t active just yet.&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;Return all the info as one big string of data seperated by spaces. We&#039;ll parse this using word$() in another&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;function. This allows the user to have more or less a &amp;quot;handle&amp;quot; to a link.&lt;/span&gt;
&amp;nbsp;
        font$ = Sys.&lt;span class=&quot;me1&quot;&gt;ReplaceChar&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;font$,&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&amp;quot;ø&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;Replace any spaces in the font text with a weird symbol, so we can parse the&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;handle with word$() in another function.&lt;/span&gt;
&amp;nbsp;
        text$ = Sys.&lt;span class=&quot;me1&quot;&gt;ReplaceChar&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;text$,&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&amp;quot;ø&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;Do the same with the text of the hyperlink. We&#039;ll reverse this in the other&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;function using Sys.ReplaceChar$(text$,&amp;quot;_&amp;quot;,&amp;quot; &amp;quot;) which will replace the underscores with spaces - so we&#039;ll be back&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;to normal. Same with the font$.&lt;/span&gt;
&amp;nbsp;
        cCc.&lt;span class=&quot;me1&quot;&gt;Hyperlink&lt;/span&gt;$=gbHndl$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;height;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;hlinkActive;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;font$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;backcolor$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;linkcolor$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;_
        eventClick$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;eventMove$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;text$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;fontHeight
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;Word 1 = handle to the graphicbox.&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;Word 2 = the width of the graphicbox&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;Word 3 = the height of the graphicbox.&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;Word 4 = 0/1 - whether or not the link is active (mouse over) hlinkActive&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;Word 5 = the font used&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;Word 6 = the backcolor&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;Word 7 = the link color&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;Word 8 = the event in which to trigger when the link is clicked.&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;Word 9 = the event in which to trigger when the mouse is moved over the gbox.&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;Word 10 = the text for the hyperlink&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;Word 11 = the height of the font&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; cC.&lt;span class=&quot;me1&quot;&gt;RollHyperlink&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;byref&lt;/span&gt; Link$, X, Y
        &lt;span class=&quot;co1&quot;&gt;&#039;Extract information from the hyperlink&#039;s handle:&lt;/span&gt;
        gbHndl$ = Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Link$,&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt; = &lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Link$,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; : height = &lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Link$,&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        hlinkActive = &lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Link$,&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; : font$ = Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Link$,&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; : backcolor$ = Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Link$,&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        linkcolor$ = Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Link$,&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; : eventClick$ = Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Link$,&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; : eventMove$ = Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Link$,&lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        text$ = Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Link$,&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; : fontHeight = &lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Link$,&lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Font &amp;quot;;font$;&amp;quot; ; Color &amp;quot;;linkcolor$;&amp;quot; ; BackColor &amp;quot;;backcolor$ &#039;Make sure the colors and fonts are set&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;right...&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;Now, replace the weird symbol in the font$ and text$ with spaces:&lt;/span&gt;
        font$ = Sys.&lt;span class=&quot;me1&quot;&gt;ReplaceChar&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;font$,&lt;span class=&quot;st0&quot;&gt;&amp;quot;ø&amp;quot;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        text$ = Sys.&lt;span class=&quot;me1&quot;&gt;ReplaceChar&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;text$,&lt;span class=&quot;st0&quot;&gt;&amp;quot;ø&amp;quot;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;Recalculate the width of the text for placement&#039;s sake:&lt;/span&gt;
            &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;StringWidth? text$ stringWidth&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;Calculate the x coordinate for text placement:&lt;/span&gt;
            Xcoord = &lt;span class=&quot;kw1&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;width-stringWidth&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;/&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;--------------------------------------------------------------------&#039;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;Check to see if the mouse coordinates (X, Y) are over the link&#039;s text - if so, we&#039;ll make sure the hyperlink&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;becomes underlined:&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;First, let&#039;s get the width of the hyperlink&#039;s text using the stringwidth? command:&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;StringWidth? text$ textWidth&amp;quot;&lt;/span&gt;
        textWidth = textWidth + &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
            &lt;span class=&quot;co1&quot;&gt;&#039;Now, we know both the width and height of the text. they are stored in textWidth and fontHeight . Perfect!&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;Now, check to see if the mouse is over the actual area the text is drawn in:&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; X&amp;lt;=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;textWidth+Xcoord&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; And X&amp;gt;=Xcoord And Y&amp;lt;=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;fontHeight+&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; And Y&amp;gt;=&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;If the mouse is in the proper area:&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Not&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hlinkActive&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
                    &lt;span class=&quot;co1&quot;&gt;&#039;If the link has not been drawn in it&#039;s mouseOver (active) state, then let&#039;s do so now.&lt;/span&gt;
                    &lt;span class=&quot;co1&quot;&gt;&#039;If hlinkActive was true (set to 1),&lt;/span&gt;
                    &lt;span class=&quot;co1&quot;&gt;&#039;it means we had already drawn it in it&#039;s active state, so we wouldn&#039;t need to redraw the same thing.&lt;/span&gt;
                    &lt;span class=&quot;co1&quot;&gt;&#039;That just causes flickering.&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;DELSEGMENT DefaultText&amp;quot; &#039;Delete the inactive (normal) drawing of the text.&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;REDRAW&amp;quot; &#039;Update the graphicbox to reflect our deletion.&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Place &amp;quot;;Xcoord;&amp;quot; &amp;quot;;fontHeight+2 &#039;Position the pen to redraw the text.&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Font &amp;quot;;font$;&amp;quot; underscore&amp;quot; &#039;Set the font to be underlined! Of course,&lt;/span&gt;
                        &lt;span class=&quot;co1&quot;&gt;&#039;if the user already has an underlined font, this is a bummer. :(&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;|&amp;quot;;text$ &#039;Draw the new, underlined text!&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Flush ActiveText&amp;quot; &#039;Make this drawing stick, and call it ActiveText -&lt;/span&gt;
                              &lt;span class=&quot;co1&quot;&gt;&#039;we can remove this drawing and redraw the old one when the mouse isn&#039;t&lt;/span&gt;
                        &lt;span class=&quot;co1&quot;&gt;&#039;over the graphicbox text area. Cool, huh?&lt;/span&gt;
                    hlinkActive = &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;The hyperlink is now in it&#039;s active state!&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;Else&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;If the mouse is NOT over the actual text area, then let&#039;s make sure that the hyperlink is drawn in it&#039;s&lt;/span&gt;
                 &lt;span class=&quot;co1&quot;&gt;&#039;inactive state.&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; hlinkActive &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;If the hyperlink is being drawn in it&#039;s active state, then let&#039;s unactivate it!&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;DELSEGMENT ActiveText&amp;quot; &#039;Remove the drawing of the active text.&lt;/span&gt;
                    &lt;span class=&quot;co1&quot;&gt;&#039;Draw the text in it&#039;s normal state:&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;REDRAW&amp;quot;&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Font &amp;quot;;font$&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Place &amp;quot;;Xcoord;&amp;quot; &amp;quot;;fontHeight+2&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;|&amp;quot;;text$&lt;/span&gt;
                    &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Flush DefaultText&amp;quot; &#039;Make it stick and call this drawing the DefaultText drawing.&lt;/span&gt;
                    hlinkActive = &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;hlinkActive is now inactive.&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;----------------------------------------------------------------------------&#039;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;Replace spaces with underscores...&lt;/span&gt;
        font$ = Sys.&lt;span class=&quot;me1&quot;&gt;ReplaceChar&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;font$,&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&amp;quot;ø&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        text$ = Sys.&lt;span class=&quot;me1&quot;&gt;ReplaceChar&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;text$,&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&amp;quot;ø&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;&#039;Change the properties of the hyperlink&#039;s handle to match the updated properties.&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;This will actually affect the user&#039;s handle, because we passed Link$ by reference. (byref in the help file)&lt;/span&gt;
        Link$=gbHndl$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;height;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;hlinkActive;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;font$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;backcolor$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;linkcolor$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;_
        eventClick$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;eventMove$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;text$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;fontHeight
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;co1&quot;&gt;&#039;This is a helper function for the hyperlink functions.&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; Sys.&lt;span class=&quot;me1&quot;&gt;ReplaceChar&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;$, FindChar$, ReplaceChar$&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;Find the character FindChar$ and replace&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;it with ReplaceChar$&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i = &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Len&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            char$=&lt;span class=&quot;kw1&quot;&gt;Mid&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;$,i,&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; char$=FindChar$ &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; char$=ReplaceChar$
            Sys.&lt;span class=&quot;me1&quot;&gt;ReplaceChar&lt;/span&gt;$=Sys.&lt;span class=&quot;me1&quot;&gt;ReplaceChar&lt;/span&gt;$;char$
        &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:13:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@c&amp;quot; title=&amp;quot;Anchor: c&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;c&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:13 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;freebasic&amp;quot;&amp;gt;Link1$ = cCc.Hyperlink$(&amp;amp;quot;#Win.Link1&amp;amp;quot;, &amp;amp;quot;Link 1 Text&amp;amp;quot;, &amp;amp;quot;Arial 10&amp;amp;quot;, &amp;amp;quot;buttonface&amp;amp;quot;, &amp;amp;quot;blue&amp;amp;quot;, &amp;amp;quot;[Link1.Click]&amp;amp;quot;, &amp;amp;quot;[Link1.Move]&amp;amp;quot;)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.freebasic  {font-family:monospace;}
.freebasic .imp {font-weight: bold; color: red;}
.freebasic .kw1 {color: #b1b100;}
.freebasic .co1 {color: #808080;}
.freebasic .co2 {color: #339933;}
.freebasic .es0 {color: #000099;}
.freebasic .br0 {color: #66cc66;}
.freebasic .sy0 {color: #66cc66;}
.freebasic .st0 {color: #ff0000;}
.freebasic .nu0 {color: #cc66cc;}
.freebasic .me0 {color: #66cc66;}
.freebasic span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;freebasic&quot;&gt;Link1$ = cCc.&lt;span class=&quot;me1&quot;&gt;Hyperlink&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;#Win.Link1&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Link 1 Text&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Arial 10&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonface&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;blue&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;[Link1.Click]&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;[Link1.Move]&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:14:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@d&amp;quot; title=&amp;quot;Anchor: d&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;d&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:14 --&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;freebasic&amp;quot;&amp;gt;Link1$ = cCc.Hyperlink$(&amp;amp;quot;#Win.Link1&amp;amp;quot;, Link1.Width, Link1.Height &amp;amp;quot;Link 1 Text&amp;amp;quot;, &amp;amp;quot;Arial 10&amp;amp;quot;, &amp;amp;quot;buttonface&amp;amp;quot;, &amp;amp;quot;blue&amp;amp;quot;,  &amp;amp;quot;[Link1.Click]&amp;amp;quot;, &amp;amp;quot;[Link1.Move]&amp;amp;quot;)&amp;lt;br/&amp;gt;Function cCc.Hyperlink$(  gbHndl$,       width,        height,      text$,       font$,     backcolor$, linkcolor$, eventClick$,    eventMove$)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.freebasic  {font-family:monospace;}
.freebasic .imp {font-weight: bold; color: red;}
.freebasic .kw1 {color: #b1b100;}
.freebasic .co1 {color: #808080;}
.freebasic .co2 {color: #339933;}
.freebasic .es0 {color: #000099;}
.freebasic .br0 {color: #66cc66;}
.freebasic .sy0 {color: #66cc66;}
.freebasic .st0 {color: #ff0000;}
.freebasic .nu0 {color: #cc66cc;}
.freebasic .me0 {color: #66cc66;}
.freebasic span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;freebasic&quot;&gt;Link1$ = cCc.&lt;span class=&quot;me1&quot;&gt;Hyperlink&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;#Win.Link1&amp;quot;&lt;/span&gt;, Link1.&lt;span class=&quot;kw1&quot;&gt;Width&lt;/span&gt;, Link1.&lt;span class=&quot;me1&quot;&gt;Height&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Link 1 Text&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Arial 10&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonface&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;blue&amp;quot;&lt;/span&gt;,  &lt;span class=&quot;st0&quot;&gt;&amp;quot;[Link1.Click]&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;[Link1.Move]&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; cCc.&lt;span class=&quot;me1&quot;&gt;Hyperlink&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;  gbHndl$,       &lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;,        height,      text$,       font$,     backcolor$, linkcolor$, eventClick$,    eventMove$&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:15:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@e&amp;quot; title=&amp;quot;Anchor: e&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;e&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:15 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;freebasic&amp;quot;&amp;gt;    [Link1.Move]&amp;lt;br/&amp;gt;        Call cC.RollHyperlink Link1$, MouseX, MouseY&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.freebasic  {font-family:monospace;}
.freebasic .imp {font-weight: bold; color: red;}
.freebasic .kw1 {color: #b1b100;}
.freebasic .co1 {color: #808080;}
.freebasic .co2 {color: #339933;}
.freebasic .es0 {color: #000099;}
.freebasic .br0 {color: #66cc66;}
.freebasic .sy0 {color: #66cc66;}
.freebasic .st0 {color: #ff0000;}
.freebasic .nu0 {color: #cc66cc;}
.freebasic .me0 {color: #66cc66;}
.freebasic span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;freebasic&quot;&gt;    &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Link1.&lt;span class=&quot;me1&quot;&gt;Move&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; cC.&lt;span class=&quot;me1&quot;&gt;RollHyperlink&lt;/span&gt; Link1$, MouseX, MouseY
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:16:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@f&amp;quot; title=&amp;quot;Anchor: f&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;f&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:16 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;freebasic&amp;quot;&amp;gt;        Link$=gbHndl$;&amp;amp;quot; &amp;amp;quot;;width;&amp;amp;quot; &amp;amp;quot;;height;&amp;amp;quot; &amp;amp;quot;;hlinkActive;&amp;amp;quot; &amp;amp;quot;;font$;&amp;amp;quot; &amp;amp;quot;;backcolor$;&amp;amp;quot; &amp;amp;quot;;linkcolor$;&amp;amp;quot; &amp;amp;quot;;_&amp;lt;br/&amp;gt;        eventClick$;&amp;amp;quot; &amp;amp;quot;;eventMove$;&amp;amp;quot; &amp;amp;quot;;text$;&amp;amp;quot; &amp;amp;quot;;fontHeight&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.freebasic  {font-family:monospace;}
.freebasic .imp {font-weight: bold; color: red;}
.freebasic .kw1 {color: #b1b100;}
.freebasic .co1 {color: #808080;}
.freebasic .co2 {color: #339933;}
.freebasic .es0 {color: #000099;}
.freebasic .br0 {color: #66cc66;}
.freebasic .sy0 {color: #66cc66;}
.freebasic .st0 {color: #ff0000;}
.freebasic .nu0 {color: #cc66cc;}
.freebasic .me0 {color: #66cc66;}
.freebasic span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;freebasic&quot;&gt;        Link$=gbHndl$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;height;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;hlinkActive;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;font$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;backcolor$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;linkcolor$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;_
        eventClick$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;eventMove$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;text$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;fontHeight
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:17:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@g&amp;quot; title=&amp;quot;Anchor: g&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;g&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:17 --&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#039;Courier New&#039;,Courier,monospace;&quot;&gt;&lt;br /&gt;
#Win.Link1 80 26 1 Arialø10 buttonface blue [Link1.Click] [Link1.Move] Linkø1øText 16&lt;br /&gt;
#Win.Link1 80 26 0 Arialø10 buttonface blue [Link1.Click] [Link1.Move] Linkø1øText 16&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:18:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@h&amp;quot; title=&amp;quot;Anchor: h&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;h&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:18 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;Sub cC.RollHyperlink byref Link$, X, Y&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;Sub cC.RollHyperlink byref Link$, X, Y&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:19:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@i&amp;quot; title=&amp;quot;Anchor: i&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;i&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:19 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;Link1$ = cCc.Hyperlink$(&amp;amp;quot;#Win.Link1&amp;amp;quot;, Link1.Width, Link1.Height, &amp;amp;quot;Link 1 Text&amp;amp;quot;, &amp;amp;quot;Arial 10&amp;amp;quot;, &amp;amp;quot;buttonface&amp;amp;quot;, &amp;amp;quot;blue&amp;amp;quot;, &amp;amp;quot;[Link1.Click]&amp;amp;quot;, &amp;amp;quot;[Link1.Move]&amp;amp;quot;)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;Link1$ = cCc.Hyperlink$(&amp;quot;#Win.Link1&amp;quot;, Link1.Width, Link1.Height, &amp;quot;Link 1 Text&amp;quot;, &amp;quot;Arial 10&amp;quot;, &amp;quot;buttonface&amp;quot;, &amp;quot;blue&amp;quot;, &amp;quot;[Link1.Click]&amp;quot;, &amp;quot;[Link1.Move]&amp;quot;)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:20:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@j&amp;quot; title=&amp;quot;Anchor: j&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;j&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:20 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;    [Link1.Move]&amp;lt;br/&amp;gt;        Call cC.RollHyperlink Link1$, MouseX, MouseY&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;    [Link1.Move]
        Call cC.RollHyperlink Link1$, MouseX, MouseY
    Wait
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:21:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@k&amp;quot; title=&amp;quot;Anchor: k&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;k&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:21 --&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#039;Courier New&#039;,Courier,monospace;&quot;&gt;Global Link1$&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
You would also have to pass the name of the sub in for the mouse over event when you use the cCc.Hyperlink$() function, instead of the name of a branch label:&lt;br /&gt;
&lt;span style=&quot;font-family: &#039;Courier New&#039;,Courier,monospace;&quot;&gt;&lt;br /&gt;
Link1$ = cCc.Hyperlink$(&amp;quot;#Win.Link1&amp;quot;, Link1.Width, Link1.Height, &amp;quot;Link 1 Text&amp;quot;, &amp;quot;Arial 10&amp;quot;, &amp;quot;buttonface&amp;quot;, &amp;quot;blue&amp;quot;, &amp;quot;[Link1.Click]&amp;quot;, &lt;span style=&quot;font-family: &#039;Courier New&#039;,Courier,monospace; background-color: rgb(253,255,0);&quot;&gt;&amp;quot;Link1.Move&amp;quot;&lt;/span&gt;)&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:22:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@l&amp;quot; title=&amp;quot;Anchor: l&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;l&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:22 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;    Sub Link1.Move GraphicBox$, X, Y&amp;lt;br/&amp;gt;            Call cC.RollHyperlink Link1$, X, Y&amp;lt;br/&amp;gt;    End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;    Sub Link1.Move GraphicBox$, X, Y
            Call cC.RollHyperlink Link1$, X, Y
    End Sub&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:23:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@m&amp;quot; title=&amp;quot;Anchor: m&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;m&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:23 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;freebasic&amp;quot;&amp;gt;    NoMainWin&amp;lt;br/&amp;gt;    WindowWidth = 600&amp;lt;br/&amp;gt;    WindowHeight = 400&amp;lt;br/&amp;gt;    Button #Win.b, &amp;amp;quot;Unstep progress bar&amp;amp;quot;,[UnStepIt],UL,4,38,130,30&amp;lt;br/&amp;gt;    Button #Win.b2, &amp;amp;quot;Step progress bar&amp;amp;quot;,[StepIt],UL,138, 38, 130, 30&amp;lt;br/&amp;gt;    Button #Win.b3, &amp;amp;quot;Set Percentage&amp;amp;quot;,[Percent],UL,4,72,130,30&amp;lt;br/&amp;gt;    GraphicBox #Win.g, 4, 4, 436, 30&amp;lt;br/&amp;gt;    Stylebits #Win.g, 0,_WS_BORDER,0,0&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Temp&amp;amp;quot; For Window_NF As #Win&amp;lt;br/&amp;gt;    #Win, &amp;amp;quot;TrapClose [Quit]&amp;amp;quot;&amp;lt;br/&amp;gt;    #Win, &amp;amp;quot;Font Arial 10&amp;amp;quot;&amp;lt;br/&amp;gt;    Prog1$ = cCc.ProgressBar$(&amp;amp;quot;#Win.g&amp;amp;quot;, 436, 30)&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    [UnStepIt]&amp;lt;br/&amp;gt;        Call cC.UnStepProgressBar Prog1$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    [StepIt]&amp;lt;br/&amp;gt;        Call cC.StepProgressBar Prog1$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    [Percent]&amp;lt;br/&amp;gt;        Prompt &amp;amp;quot;Choose percentage (0-100):&amp;amp;quot;; Percent&amp;lt;br/&amp;gt;        Call cC.SetProgressBarPercent Prog1$, Percent&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    [Quit]&amp;lt;br/&amp;gt;    Close #Win&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;*****************************************************************************************************************&#039;&amp;lt;br/&amp;gt;&#039;BEGIN PROGRESS BAR FUNCTIONS ************************************************************************************&#039;&amp;lt;br/&amp;gt;&#039;*****************************************************************************************************************&#039;&amp;lt;br/&amp;gt;    Function cCc.ProgressBar$(gbHndlb$, width, height) &#039;Create Custom Control Progress Bar&amp;lt;br/&amp;gt;        gbHndl$ = Word$(gbHndlb$,1)&amp;lt;br/&amp;gt;        &#039;Border drawing...sad this takes up a ton of code :( - but looks beautiful!&amp;lt;br/&amp;gt;        dkGray$ = &amp;amp;quot;102 102 102&amp;amp;quot; : mdGray$ = &amp;amp;quot;185 185 185&amp;amp;quot; : ltGray$ = &amp;amp;quot;234 234 234&amp;amp;quot;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;CLS;Down;Fill White ; Size 1 ; Color &amp;amp;quot;;ltGray$;&amp;amp;quot;; Set 0 0 ; Color &amp;amp;quot;;dkGray$;&amp;amp;quot;; Line 1 0 &amp;amp;quot;;(width-3);_&amp;lt;br/&amp;gt;        &amp;amp;quot; 0 ; Color 124 124 124 ; set &amp;amp;quot;;(width-3);&amp;amp;quot; 0&amp;amp;quot;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color 167 167 170 ; Set &amp;amp;quot;;(width-2);&amp;amp;quot; 0 ; Color 178 178 178 ; Set 0 1 ; Color 127 127 127 ; Set 0 2&amp;amp;quot;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color &amp;amp;quot;;mdGray$;&amp;amp;quot; ; Line 1 1 &amp;amp;quot;;(width-2);&amp;amp;quot; 1 ; Color 117 117 117 ; Set &amp;amp;quot;;(width-2);&amp;amp;quot; 1&amp;amp;quot;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color 167 167 170 ; Set &amp;amp;quot;;(width-1);&amp;amp;quot; 1 ; Color 124 124 124 ; Set &amp;amp;quot;;(width-1);&amp;amp;quot; 2&amp;amp;quot;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color &amp;amp;quot;;ltGray$;&amp;amp;quot; ; Line 1 2 &amp;amp;quot;;(width-2);&amp;amp;quot; 2 ; Color &amp;amp;quot;;mdGray$;&amp;amp;quot;;Set &amp;amp;quot;;(width-3);&amp;amp;quot; 1 ; Set &amp;amp;quot;;(width-2);&amp;amp;quot; 2&amp;amp;quot;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Set &amp;amp;quot;;(width-3);&amp;amp;quot; 2 ; Color &amp;amp;quot;;dkGray$;&amp;amp;quot; ; Line 0 3 0 &amp;amp;quot;;(height-3)&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color 124 124 124 ; Set 0 &amp;amp;quot;;(height-3);&amp;amp;quot; ; Color 167 167 167 ; Set 0 &amp;amp;quot;;(height-2)&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color &amp;amp;quot;;dkGray$;&amp;amp;quot; ; Line 1 &amp;amp;quot;;(height-1);&amp;amp;quot; &amp;amp;quot;;(width-3);&amp;amp;quot; &amp;amp;quot;;(height-1);&amp;amp;quot;;Line &amp;amp;quot;;(width-1);&amp;amp;quot; 3 &amp;amp;quot;;(width-1);&amp;amp;quot; &amp;amp;quot;;(height-3)&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color 124 124 124 ; Set &amp;amp;quot;;(width-1);&amp;amp;quot; &amp;amp;quot;;(height-3);&amp;amp;quot;; Set &amp;amp;quot;;(width-2); &amp;amp;quot; &amp;amp;quot;;(height-2);&amp;amp;quot;;Set &amp;amp;quot;;(width-3);&amp;amp;quot; &amp;amp;quot;;(height-1)&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color 167 167 167 ; Set &amp;amp;quot;;(width-1);&amp;amp;quot; &amp;amp;quot;;(height-2);&amp;amp;quot;; Set &amp;amp;quot;;(width-2); &amp;amp;quot; &amp;amp;quot;;(height-1);&amp;amp;quot;;Color &amp;amp;quot;;ltGray$;_&amp;lt;br/&amp;gt;        &amp;amp;quot;; Line 1 &amp;amp;quot;;(height-2);&amp;amp;quot; &amp;amp;quot;;(width-2);&amp;amp;quot; &amp;amp;quot;;(height-2)&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color &amp;amp;quot;;mdGray$;&amp;amp;quot;; Line &amp;amp;quot;;(width-2);&amp;amp;quot; 2 &amp;amp;quot;;(width-2);&amp;amp;quot; &amp;amp;quot;;(height-2);&amp;amp;quot;;Color &amp;amp;quot;;ltGray$;&amp;amp;quot;; Line &amp;amp;quot;;(width-3);&amp;amp;quot; 3 &amp;amp;quot;;_&amp;lt;br/&amp;gt;        (width-3);&amp;amp;quot; &amp;amp;quot;;(height-2)&amp;lt;br/&amp;gt;        barWidth = Int(width/50)&amp;lt;br/&amp;gt;        padWidth = Int(width/218)&amp;lt;br/&amp;gt;        maxBars = Int(width/(barWidth+padWidth)) &#039;holds how many bars this progressbar holds...&amp;lt;br/&amp;gt;        cCc.ProgressBar$ = gbHndl$;&amp;amp;quot; &amp;amp;quot;;width;&amp;amp;quot; &amp;amp;quot;;height;&amp;amp;quot; &amp;amp;quot;;barWidth;&amp;amp;quot; &amp;amp;quot;;padWidth;&amp;amp;quot; &amp;amp;quot;;barCount;&amp;amp;quot; &amp;amp;quot;;maxBars&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;backcolor 255 255 255&amp;amp;quot;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Flush&amp;amp;quot;&amp;lt;br/&amp;gt;    End Function&amp;lt;br/&amp;gt;    Sub cC.SetProgressBarPercent byref progHndl$, percent&amp;lt;br/&amp;gt;        gbHndl$=Word$(progHndl$,1):width=Val(Word$(progHndl$,2)):height=Val(Word$(progHndl$,3)):barWidth=Val(Word$(progHndl$,4))&amp;lt;br/&amp;gt;        padWidth=Val(Word$(progHndl$,5)):barCount=Val(Word$(progHndl$,6)):maxBars=Val(Word$(progHndl$,7))&amp;lt;br/&amp;gt;        p = Int((maxBars/100)*percent)&amp;lt;br/&amp;gt;        If p = 0 Then&amp;lt;br/&amp;gt;            progHndl$=cCc.ProgressBar$(gbHndl$;&amp;amp;quot; .&amp;amp;quot;, width, height)&amp;lt;br/&amp;gt;            Exit Sub&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;        If p&amp;amp;gt;barCount Then&amp;lt;br/&amp;gt;            dif = p-barCount&amp;lt;br/&amp;gt;            For i = 1 To dif&amp;lt;br/&amp;gt;                Call cC.StepProgressBar progHndl$&amp;lt;br/&amp;gt;            Next i&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;        If p&amp;amp;lt;barCount Then&amp;lt;br/&amp;gt;            dif = barCount - p&amp;lt;br/&amp;gt;            For i = 1 to dif&amp;lt;br/&amp;gt;                Call cC.UnStepProgressBar progHndl$&amp;lt;br/&amp;gt;            Next i&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;        progHndl$ = progHndl$&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;    Sub cC.StepProgressBar byref progHndl$&amp;lt;br/&amp;gt;        gbHndl$=Word$(progHndl$,1):width=Val(Word$(progHndl$,2)):height=Val(Word$(progHndl$,3)):barWidth=Val(Word$(progHndl$,4))&amp;lt;br/&amp;gt;        padWidth=Val(Word$(progHndl$,5)):barCount=Val(Word$(progHndl$,6)):maxBars=Val(Word$(progHndl$,7))&amp;lt;br/&amp;gt;        barCount=barCount+1&amp;lt;br/&amp;gt;        If barCount&amp;amp;gt;maxBars Then Exit Sub&amp;lt;br/&amp;gt;        If barCount&amp;amp;gt;1 Then Lx=((barWidth+padWidth)*(barCount-1))+1 Else Lx=1&amp;lt;br/&amp;gt;        LxF = Lx+barWidth&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color 181 200 226;Line &amp;amp;quot;;Lx;&amp;amp;quot; 1 &amp;amp;quot;;LxF;&amp;amp;quot; 1;Color 164 191 221;Line &amp;amp;quot;;Lx;&amp;amp;quot; 2 &amp;amp;quot;;LxF;&amp;amp;quot; 2;Color 146 180 219;Line &amp;amp;quot;;_&amp;lt;br/&amp;gt;        Lx;&amp;amp;quot; 3 &amp;amp;quot;;LxF;&amp;amp;quot; 3&amp;amp;quot;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color 130 166 214;Line &amp;amp;quot;;Lx;&amp;amp;quot; 4 &amp;amp;quot;;LxF;&amp;amp;quot; 4;Color 114 156 211;Line &amp;amp;quot;;Lx;&amp;amp;quot; 5 &amp;amp;quot;;LxF;&amp;amp;quot; 5;Color 95 145 206;Line &amp;amp;quot;;_&amp;lt;br/&amp;gt;        Lx;&amp;amp;quot; 6 &amp;amp;quot;;LxF;&amp;amp;quot; 6&amp;amp;quot;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;BackColor 87 138 204; Color 87 138 204; Size 1; Place &amp;amp;quot;;Lx;&amp;amp;quot; 7; BoxFilled &amp;amp;quot;;LxF;&amp;amp;quot; &amp;amp;quot;;(height-6)&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color 90 142 206;Line &amp;amp;quot;;Lx;&amp;amp;quot; &amp;amp;quot;;(height-6);&amp;amp;quot; &amp;amp;quot;;LxF;&amp;amp;quot; &amp;amp;quot;;(height-6);&amp;amp;quot;; Color 104 151 209;Line &amp;amp;quot;;Lx;&amp;amp;quot; &amp;amp;quot;;(height-5);&amp;amp;quot; &amp;amp;quot;;_&amp;lt;br/&amp;gt;        LxF;&amp;amp;quot; &amp;amp;quot;;(height-5)&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color 124 163 214;Line &amp;amp;quot;;Lx;&amp;amp;quot; &amp;amp;quot;;(height-4);&amp;amp;quot; &amp;amp;quot;;LxF;&amp;amp;quot; &amp;amp;quot;;(height-4);&amp;amp;quot;;Color 140 173 216;Line &amp;amp;quot;;Lx;&amp;amp;quot; &amp;amp;quot;;(height-3);&amp;amp;quot; &amp;amp;quot;;_&amp;lt;br/&amp;gt;        LxF;&amp;amp;quot; &amp;amp;quot;;(height-3)&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Color 159 187 221;Line &amp;amp;quot;;Lx;&amp;amp;quot; &amp;amp;quot;;(height-2);&amp;amp;quot; &amp;amp;quot;;LxF;&amp;amp;quot; &amp;amp;quot;;(height-2)&amp;lt;br/&amp;gt;        progHndl$ = gbHndl$;&amp;amp;quot; &amp;amp;quot;;width;&amp;amp;quot; &amp;amp;quot;;height;&amp;amp;quot; &amp;amp;quot;;barWidth;&amp;amp;quot; &amp;amp;quot;;padWidth;&amp;amp;quot; &amp;amp;quot;;barCount;&amp;amp;quot; &amp;amp;quot;;maxBars&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Backcolor 255 255 255&amp;amp;quot;&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;Flush bar&amp;amp;quot;;barCount&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;    Sub cC.UnStepProgressBar byref progHndl$&amp;lt;br/&amp;gt;        gbHndl$=Word$(progHndl$,1):width=Val(Word$(progHndl$,2)):height=Val(Word$(progHndl$,3)):barWidth=Val(Word$(progHndl$,4))&amp;lt;br/&amp;gt;        padWidth=Val(Word$(progHndl$,5)):barCount=Val(Word$(progHndl$,6)):maxBars=Val(Word$(progHndl$,7))&amp;lt;br/&amp;gt;        If barCount=0 Then Exit Sub&amp;lt;br/&amp;gt;        barSeg = barCount&#039; + 1&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;delsegment bar&amp;amp;quot;;barSeg&amp;lt;br/&amp;gt;        #gbHndl$, &amp;amp;quot;redraw&amp;amp;quot;&amp;lt;br/&amp;gt;        if barCount&amp;amp;gt;0 Then barCount=barCount-1&amp;lt;br/&amp;gt;        progHndl$ = gbHndl$;&amp;amp;quot; &amp;amp;quot;;width;&amp;amp;quot; &amp;amp;quot;;height;&amp;amp;quot; &amp;amp;quot;;barWidth;&amp;amp;quot; &amp;amp;quot;;padWidth;&amp;amp;quot; &amp;amp;quot;;barCount;&amp;amp;quot; &amp;amp;quot;;maxBars&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&#039;*****************************************************************************************************************&#039;&amp;lt;br/&amp;gt;&#039;END PROGRESS BAR FUNCTIONS **************************************************************************************&#039;&amp;lt;br/&amp;gt;&#039;*****************************************************************************************************************&#039;&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.freebasic  {font-family:monospace;}
.freebasic .imp {font-weight: bold; color: red;}
.freebasic .kw1 {color: #b1b100;}
.freebasic .co1 {color: #808080;}
.freebasic .co2 {color: #339933;}
.freebasic .es0 {color: #000099;}
.freebasic .br0 {color: #66cc66;}
.freebasic .sy0 {color: #66cc66;}
.freebasic .st0 {color: #ff0000;}
.freebasic .nu0 {color: #cc66cc;}
.freebasic .me0 {color: #66cc66;}
.freebasic span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;freebasic&quot;&gt;    NoMainWin
    WindowWidth = &lt;span class=&quot;nu0&quot;&gt;600&lt;/span&gt;
    WindowHeight = &lt;span class=&quot;nu0&quot;&gt;400&lt;/span&gt;
    Button &lt;span class=&quot;co2&quot;&gt;#Win.b, &amp;quot;Unstep progress bar&amp;quot;,[UnStepIt],UL,4,38,130,30&lt;/span&gt;
    Button &lt;span class=&quot;co2&quot;&gt;#Win.b2, &amp;quot;Step progress bar&amp;quot;,[StepIt],UL,138, 38, 130, 30&lt;/span&gt;
    Button &lt;span class=&quot;co2&quot;&gt;#Win.b3, &amp;quot;Set Percentage&amp;quot;,[Percent],UL,4,72,130,30&lt;/span&gt;
    GraphicBox &lt;span class=&quot;co2&quot;&gt;#Win.g, 4, 4, 436, 30&lt;/span&gt;
    Stylebits &lt;span class=&quot;co2&quot;&gt;#Win.g, 0,_WS_BORDER,0,0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Temp&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; Window_NF &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;#Win&lt;/span&gt;
    &lt;span class=&quot;co2&quot;&gt;#Win, &amp;quot;TrapClose [Quit]&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;co2&quot;&gt;#Win, &amp;quot;Font Arial 10&amp;quot;&lt;/span&gt;
    Prog1$ = cCc.&lt;span class=&quot;me1&quot;&gt;ProgressBar&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;#Win.g&amp;quot;&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;436&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;UnStepIt&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; cC.&lt;span class=&quot;me1&quot;&gt;UnStepProgressBar&lt;/span&gt; Prog1$
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;StepIt&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; cC.&lt;span class=&quot;me1&quot;&gt;StepProgressBar&lt;/span&gt; Prog1$
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Percent&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
        Prompt &lt;span class=&quot;st0&quot;&gt;&amp;quot;Choose percentage (0-100):&amp;quot;&lt;/span&gt;; Percent
        &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; cC.&lt;span class=&quot;me1&quot;&gt;SetProgressBarPercent&lt;/span&gt; Prog1$, Percent
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Quit&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Close&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;#Win&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;*****************************************************************************************************************&#039;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;BEGIN PROGRESS BAR FUNCTIONS ************************************************************************************&#039;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;*****************************************************************************************************************&#039;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; cCc.&lt;span class=&quot;me1&quot;&gt;ProgressBar&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gbHndlb$, &lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;, height&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;Create Custom Control Progress Bar&lt;/span&gt;
        gbHndl$ = Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gbHndlb$,&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;&#039;Border drawing...sad this takes up a ton of code :( - but looks beautiful!&lt;/span&gt;
        dkGray$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;102 102 102&amp;quot;&lt;/span&gt; : mdGray$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;185 185 185&amp;quot;&lt;/span&gt; : ltGray$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;234 234 234&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;CLS;Down;Fill White ; Size 1 ; Color &amp;quot;;ltGray$;&amp;quot;; Set 0 0 ; Color &amp;quot;;dkGray$;&amp;quot;; Line 1 0 &amp;quot;;(width-3);_&lt;/span&gt;
        &lt;span class=&quot;st0&quot;&gt;&amp;quot; 0 ; Color 124 124 124 ; set &amp;quot;&lt;/span&gt;;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;width-&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 0&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color 167 167 170 ; Set &amp;quot;;(width-2);&amp;quot; 0 ; Color 178 178 178 ; Set 0 1 ; Color 127 127 127 ; Set 0 2&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color &amp;quot;;mdGray$;&amp;quot; ; Line 1 1 &amp;quot;;(width-2);&amp;quot; 1 ; Color 117 117 117 ; Set &amp;quot;;(width-2);&amp;quot; 1&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color 167 167 170 ; Set &amp;quot;;(width-1);&amp;quot; 1 ; Color 124 124 124 ; Set &amp;quot;;(width-1);&amp;quot; 2&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color &amp;quot;;ltGray$;&amp;quot; ; Line 1 2 &amp;quot;;(width-2);&amp;quot; 2 ; Color &amp;quot;;mdGray$;&amp;quot;;Set &amp;quot;;(width-3);&amp;quot; 1 ; Set &amp;quot;;(width-2);&amp;quot; 2&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Set &amp;quot;;(width-3);&amp;quot; 2 ; Color &amp;quot;;dkGray$;&amp;quot; ; Line 0 3 0 &amp;quot;;(height-3)&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color 124 124 124 ; Set 0 &amp;quot;;(height-3);&amp;quot; ; Color 167 167 167 ; Set 0 &amp;quot;;(height-2)&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color &amp;quot;;dkGray$;&amp;quot; ; Line 1 &amp;quot;;(height-1);&amp;quot; &amp;quot;;(width-3);&amp;quot; &amp;quot;;(height-1);&amp;quot;;Line &amp;quot;;(width-1);&amp;quot; 3 &amp;quot;;(width-1);&amp;quot; &amp;quot;;(height-3)&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color 124 124 124 ; Set &amp;quot;;(width-1);&amp;quot; &amp;quot;;(height-3);&amp;quot;; Set &amp;quot;;(width-2); &amp;quot; &amp;quot;;(height-2);&amp;quot;;Set &amp;quot;;(width-3);&amp;quot; &amp;quot;;(height-1)&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color 167 167 167 ; Set &amp;quot;;(width-1);&amp;quot; &amp;quot;;(height-2);&amp;quot;; Set &amp;quot;;(width-2); &amp;quot; &amp;quot;;(height-1);&amp;quot;;Color &amp;quot;;ltGray$;_&lt;/span&gt;
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;; Line 1 &amp;quot;&lt;/span&gt;;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;height-&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;width-&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;height-&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color &amp;quot;;mdGray$;&amp;quot;; Line &amp;quot;;(width-2);&amp;quot; 2 &amp;quot;;(width-2);&amp;quot; &amp;quot;;(height-2);&amp;quot;;Color &amp;quot;;ltGray$;&amp;quot;; Line &amp;quot;;(width-3);&amp;quot; 3 &amp;quot;;_&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;width-&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;height-&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        barWidth = &lt;span class=&quot;kw1&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;/&lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        padWidth = &lt;span class=&quot;kw1&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;/&lt;span class=&quot;nu0&quot;&gt;218&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        maxBars = &lt;span class=&quot;kw1&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;/&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;barWidth+padWidth&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;holds how many bars this progressbar holds...&lt;/span&gt;
        cCc.&lt;span class=&quot;me1&quot;&gt;ProgressBar&lt;/span&gt;$ = gbHndl$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;height;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;barWidth;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;padWidth;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;barCount;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;maxBars
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;backcolor 255 255 255&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Flush&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; cC.&lt;span class=&quot;me1&quot;&gt;SetProgressBarPercent&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;byref&lt;/span&gt; progHndl$, percent
        gbHndl$=Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:height=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:barWidth=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        padWidth=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:barCount=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:maxBars=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        p = &lt;span class=&quot;kw1&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;maxBars/&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;*percent&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; p = &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
            progHndl$=cCc.&lt;span class=&quot;me1&quot;&gt;ProgressBar&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gbHndl$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; .&amp;quot;&lt;/span&gt;, &lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;, height&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;Exit&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; p&amp;gt;barCount &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
            dif = p-barCount
            &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i = &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; dif
                &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; cC.&lt;span class=&quot;me1&quot;&gt;StepProgressBar&lt;/span&gt; progHndl$
            &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; p&amp;lt;barCount &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
            dif = barCount - p
            &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i = &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; dif
                &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; cC.&lt;span class=&quot;me1&quot;&gt;UnStepProgressBar&lt;/span&gt; progHndl$
            &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
        progHndl$ = progHndl$
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; cC.&lt;span class=&quot;me1&quot;&gt;StepProgressBar&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;byref&lt;/span&gt; progHndl$
        gbHndl$=Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:height=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:barWidth=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        padWidth=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:barCount=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:maxBars=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        barCount=barCount+&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; barCount&amp;gt;maxBars &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Exit&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; barCount&amp;gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; Lx=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;barWidth+padWidth&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;barCount-&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;+&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Else&lt;/span&gt; Lx=&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
        LxF = Lx+barWidth
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color 181 200 226;Line &amp;quot;;Lx;&amp;quot; 1 &amp;quot;;LxF;&amp;quot; 1;Color 164 191 221;Line &amp;quot;;Lx;&amp;quot; 2 &amp;quot;;LxF;&amp;quot; 2;Color 146 180 219;Line &amp;quot;;_&lt;/span&gt;
        Lx;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 3 &amp;quot;&lt;/span&gt;;LxF;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 3&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color 130 166 214;Line &amp;quot;;Lx;&amp;quot; 4 &amp;quot;;LxF;&amp;quot; 4;Color 114 156 211;Line &amp;quot;;Lx;&amp;quot; 5 &amp;quot;;LxF;&amp;quot; 5;Color 95 145 206;Line &amp;quot;;_&lt;/span&gt;
        Lx;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 6 &amp;quot;&lt;/span&gt;;LxF;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 6&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;BackColor 87 138 204; Color 87 138 204; Size 1; Place &amp;quot;;Lx;&amp;quot; 7; BoxFilled &amp;quot;;LxF;&amp;quot; &amp;quot;;(height-6)&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color 90 142 206;Line &amp;quot;;Lx;&amp;quot; &amp;quot;;(height-6);&amp;quot; &amp;quot;;LxF;&amp;quot; &amp;quot;;(height-6);&amp;quot;; Color 104 151 209;Line &amp;quot;;Lx;&amp;quot; &amp;quot;;(height-5);&amp;quot; &amp;quot;;_&lt;/span&gt;
        LxF;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;height-&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color 124 163 214;Line &amp;quot;;Lx;&amp;quot; &amp;quot;;(height-4);&amp;quot; &amp;quot;;LxF;&amp;quot; &amp;quot;;(height-4);&amp;quot;;Color 140 173 216;Line &amp;quot;;Lx;&amp;quot; &amp;quot;;(height-3);&amp;quot; &amp;quot;;_&lt;/span&gt;
        LxF;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;height-&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Color 159 187 221;Line &amp;quot;;Lx;&amp;quot; &amp;quot;;(height-2);&amp;quot; &amp;quot;;LxF;&amp;quot; &amp;quot;;(height-2)&lt;/span&gt;
        progHndl$ = gbHndl$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;height;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;barWidth;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;padWidth;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;barCount;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;maxBars
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Backcolor 255 255 255&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;Flush bar&amp;quot;;barCount&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; cC.&lt;span class=&quot;me1&quot;&gt;UnStepProgressBar&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;byref&lt;/span&gt; progHndl$
        gbHndl$=Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:height=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:barWidth=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        padWidth=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:barCount=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:maxBars=&lt;span class=&quot;kw1&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Word$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;progHndl$,&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; barCount=&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Exit&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
        barSeg = barCount&lt;span class=&quot;co1&quot;&gt;&#039; + 1&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;delsegment bar&amp;quot;;barSeg&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#gbHndl$, &amp;quot;redraw&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; barCount&amp;gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; barCount=barCount-&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
        progHndl$ = gbHndl$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;&lt;span class=&quot;kw1&quot;&gt;width&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;height;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;barWidth;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;padWidth;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;barCount;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;maxBars
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;*****************************************************************************************************************&#039;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;END PROGRESS BAR FUNCTIONS **************************************************************************************&#039;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;*****************************************************************************************************************&#039;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;</description>
          </item>
    <item>
      <title>CustomControlsBox</title>
      <link>https://lbpe.wikispaces.com/CustomControlsBox</link>
      <dc:creator>JanetTerra</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/CustomControlsBox</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/CustomControlsBox</comments>
      <pubDate>Thu, 09 Apr 2009 13:16:11 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:0:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Custom Controls in a Box (user:lbjoseph)&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:0 --&gt;Custom Controls in a Box (&lt;!-- ws:start:WikiTextUserlinkRule:00:[[user:lbjoseph]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/lbjoseph&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/lbjoseph-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;lbjoseph&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/lbjoseph&quot; style=&quot;outline: none;&quot;&gt;lbjoseph&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:00 --&gt;)&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:2:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Custom Controls in a Box (user:lbjoseph)--Making your own custom control with a graphicbox in Liberty BASIC.&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:2 --&gt;Making your own custom control with a graphicbox in Liberty BASIC.&lt;/h3&gt;
 &lt;br /&gt;
Throughout the ages, mankind has sought after customization and personalization. Now, with the power of Liberty BASIC 4, you can create your very own custom control inside of a simple graphicbox. The following article expects you to be familiar with the Liberty BASIC language, as well as with Liberty BASIC&#039;s native &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasicuniversity.com/lb4help/0D14N5.htm&quot; rel=&quot;nofollow&quot;&gt;drawing commands&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
In this article, we will discuss the techniques that I (&lt;!-- ws:start:WikiTextUserlinkRule:01:[[user:lbjoseph]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/lbjoseph&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/lbjoseph-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;lbjoseph&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/lbjoseph&quot; style=&quot;outline: none;&quot;&gt;lbjoseph&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:01 --&gt;) think are necessary to creating a good custom control.&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode&quot;&gt;Code for this article is on a separate page.&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextTocRule:20:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:20 --&gt;&lt;!-- ws:start:WikiTextTocRule:21: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Custom Controls in a Box (user:lbjoseph)&quot;&gt;Custom Controls in a Box (user:lbjoseph)&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextTocRule:22: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Custom Controls in a Box (user:lbjoseph)--Making your own custom control with a graphicbox in Liberty BASIC.&quot;&gt;Making your own custom control with a graphicbox in Liberty BASIC.&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;!-- ws:start:WikiTextTocRule:23: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Custom Controls in a Box (user:lbjoseph)-Why a custom control?&quot;&gt;Why a custom control?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Custom Controls in a Box (user:lbjoseph)-The container&quot;&gt;The container&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Custom Controls in a Box (user:lbjoseph)-The foundation of what we want&quot;&gt;The foundation of what we want&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Custom Controls in a Box (user:lbjoseph)-Data management&quot;&gt;Data management&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Custom Controls in a Box (user:lbjoseph)-The guts of our hyperlink program&quot;&gt;The guts of our hyperlink program&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Custom Controls in a Box (user:lbjoseph)-What does it all mean?&quot;&gt;What does it all mean?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Custom Controls in a Box (user:lbjoseph)-Utilizing the hyperlink&quot;&gt;Utilizing the hyperlink&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Custom Controls in a Box (user:lbjoseph)-Conclusion and a Progress bar control&quot;&gt;Conclusion and a Progress bar control&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:4:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Custom Controls in a Box (user:lbjoseph)-Why a custom control?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:4 --&gt;Why a custom control?&lt;/h2&gt;
 Because you can. But there&#039;s more to it than that - by creating your own custom control, its look and feel will stay consistent throughout all the various versions of Windows. Secondly, you can make them much easier to use than the Windows API controls. It is also possible to setup your custom control&#039;s functions/subs without global variables (depending on what kind of control you make). Another advantage of custom controls is that they do not require a huge wrapper of subs and functions to deal with the Windows API calls, callbacks, messages, and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:6:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Custom Controls in a Box (user:lbjoseph)-The container&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:6 --&gt;The container&lt;/h2&gt;
 First of all, we need some sort of object that we can manipulate to turn into our own object. The Liberty BASIC &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasicuniversity.com/lb4help/13BQ1SK.htm&quot; rel=&quot;nofollow&quot;&gt;graphicbox&lt;/a&gt; is just the thing. Not only does it let you draw on it with LB&#039;s native drawing commands, but it lets you set event handlers to branch labels or subs when it is clicked, etc. This allows you to make a click-able control that looks beautiful to the eyes (some sarcasm implied).&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:8:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Custom Controls in a Box (user:lbjoseph)-The foundation of what we want&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:8 --&gt;The foundation of what we want&lt;/h2&gt;
 In this article we&#039;ll walk through custom control creation by creating a &amp;quot;fake&amp;quot; hyperlink control. There&#039;s are a couple of things we want specifically from this control:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;It needs to have a roll-over effect (becomes underlined upon mouse-over)&lt;/li&gt;&lt;li&gt;We want to be able to create as many as we like&lt;/li&gt;&lt;li&gt;And we want it to specify its properties upon creation - like background color, text color, font, etc.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;
So, let&#039;s go ahead and create the basis of our program. We&#039;ll need a window with a graphicbox in place and a trapclose event setup so our program will actually close when someone hits the little red x.&lt;br /&gt;
&lt;br /&gt;
If we wanted to have more than one hyperlink, we&#039;d make a graphicbox for every link we want. More on that later.&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#a&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
If you run the code above, things don&#039;t look too promising. However, this is just the foundation of our program.&lt;br /&gt;
&lt;br /&gt;
There are a couple of things you need to note about the above code:&lt;br /&gt;
&lt;br /&gt;
First, we issued a &amp;quot;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasicuniversity.com/lb4help/STYLEBITS.htm&quot; rel=&quot;nofollow&quot;&gt;Stylebits&lt;/a&gt;&amp;quot; Command - we used the flag _WS_BORDER in the removeBits section. This removes the border of the graphicbox. This command is necessary to remove clutter which could mess up the way our control looks (especially in a dialog window).&lt;br /&gt;
&lt;br /&gt;
Secondly, we created two &amp;quot;stubs&amp;quot; - [Link1.Click] and [Link1.Move] - these are event handlers for graphicbox. We&#039;ll find out what these are for shortly.&lt;br /&gt;
&lt;br /&gt;
Now we have the foundation of a custom control - a graphicbox without a clunky border and two stubs for when the user clicks the graphicbox, and moves the mouse over the graphicbox.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:10:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Custom Controls in a Box (user:lbjoseph)-Data management&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:10 --&gt;Data management&lt;/h2&gt;
 Here&#039;s where the fun begins. We know we need several parameters to create a hyperlink:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;We need the handle to the &amp;quot;parent&amp;quot; graphicbox container. We&#039;ll call this variable &amp;quot;gbHndl$&amp;quot;. In our case, the programmer would pass the value &amp;quot;#Win.Link1&amp;quot; into the function.&lt;/li&gt;&lt;li&gt;We need the width of the hyperlink - we&#039;ll call this &amp;quot;width&amp;quot;&lt;/li&gt;&lt;li&gt;We need the height of the hyperlink - we&#039;ll call this &amp;quot;height&amp;quot;&lt;/li&gt;&lt;li&gt;We need the text for the hyperlink - we&#039;ll call this &amp;quot;text$&amp;quot;&lt;/li&gt;&lt;li&gt;We need to know what font to use - we&#039;ll call this &amp;quot;font$&amp;quot;&lt;/li&gt;&lt;li&gt;We need to know the background color of the window the link is on (so it won&#039;t look ugly) - we&#039;ll call this &amp;quot;backcolor$&amp;quot;&lt;/li&gt;&lt;li&gt;We need to know what color to make the hyperlink -we&#039;ll call this &amp;quot;linkcolor$&amp;quot;&lt;/li&gt;&lt;li&gt;We need the name of the sub or branch label that contains the user&#039;s code to execute upon clicking the link. We&#039;ll call this &amp;quot;eventClick$&amp;quot;. In our case, the programmer would pass the value &amp;quot;[Link1.Click]&amp;quot; into the function.&lt;/li&gt;&lt;li&gt;We&#039;ll need the name of the sub or branch label that contains the user&#039;s code to execute when the mouse moves over the link. We&#039;ll call this &amp;quot;eventMove$&amp;quot;&lt;/li&gt;&lt;li&gt;We need the height of the font the user specified for the hyperlink - we&#039;ll call this &amp;quot;fontHeight&amp;quot;&lt;/li&gt;&lt;li&gt;The hyperlink also needs to know what state it is in - whether or not is &amp;quot;active&amp;quot;. We&#039;ll call this &amp;quot;hlinkActive&amp;quot;.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;
We keep track of 11 variables for the hyperlink. We&#039;ll need to remember these so we can render the hyperlink. To avoid flickering the graphicbox, we&#039;ll only render the hyperlink when we absolutely need to. By calculating to see if the mouse is inside the coordinates of the text, we can find out whether or not to underline the hyperlink. If so, we&#039;ll redraw the link and change the value of hlinkActive to 1 (if the mouse is over the text) or 0 (if the mouse is not over the text).&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:12:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Custom Controls in a Box (user:lbjoseph)-The guts of our hyperlink program&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:12 --&gt;The guts of our hyperlink program&lt;/h2&gt;
 Here&#039;s the updated program (heavily commented) with the sub and functions required for the hyperlink:&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#b&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:14:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Custom Controls in a Box (user:lbjoseph)-What does it all mean?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:14 --&gt;What does it all mean?&lt;/h2&gt;
 To make the most out of this, you should probably look over the code and read the comments. It&#039;s designed to be easy to understand. You should be able to keep up quite well after doing so.&lt;br /&gt;
&lt;br /&gt;
The function cCc.Hyperlink$ (the cCc stands for create custom control) is called after the window has been setup like this:&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#c&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The arguments passed into this function correspond with the parameters (representational variables) received by the function cCc.Hyperlink$():&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#d&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The function returns a string of values put together. When we called this function, we assigned the variable Link1$ to be that string.&lt;br /&gt;
&lt;br /&gt;
Earlier, we mentioned that we need an event for when the mouse moves over the link. If you compare the two above, you&#039;ll notice that we specified the branch label [Link1.Move] to be the block of code that Liberty jumps to when the mouse moves over the graphicbox #Win.Link1. Let&#039;s take a look at that block:&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#e&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Notice that we called the sub in our program. This sub, cC.RollHyperlink (cC stands for Custom Control), checks to see if the mouse is directly over the rendered text (using the graphics commands, and a little bit of math and conditional checking). The sub then draws the hyperlink either in its active (underlined) form or inactive (not underlined) form depending on if the mouse is over it or not.&lt;br /&gt;
&lt;br /&gt;
In the sub, we passed the value Link1$ as the handle to our link. It contains the string of information returned by the cCc.Hyperlink$() function. The sub breaks this information down, and uses it to see if it needs to redraw the hyperlink. If it does, it changes the value of the paremeter hlinkActive, which happens to be second word inside Link1$.&lt;br /&gt;
&lt;br /&gt;
When the sub is done, it puts the link handle back together:&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#f&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now, remember that in our case, we passed the value Link1$ in the sub. If you were to compare the values of the string variable Link1$ when the mouse is over, and when it is not, you would get this:&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#g&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The first line is the value of Link1$ when the mouse is over the link. The second line is the value when the mouse is not over. There is only one difference between the two, and that is found in the fourth word. If you looked at the code, you&#039;d realize that the fourth word in the &amp;quot;handle&amp;quot; of our link is the value of hlinkActive. But how are we able to change the actual value of a handle from the sub?&lt;br /&gt;
&lt;br /&gt;
We take advantage of passing an argument by reference. Look at this:&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#h&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Notice the little &amp;quot;byref&amp;quot; that is thrown in right before Link$ (the parameter that represents the handle of the link passed in). Even though it doesn&#039;t turn blue in the Liberty BASIC 4.03 editor, it is still a recognized specification by Liberty BASIC&#039;s standards. Whenever you pass a variable into a sub or function by reference, the sub or function can actually modify the value of the variable you gave it! Isn&#039;t that amazing? Ok, well maybe it doesn&#039;t blow you out of your seat, but it can be really useful - as we just saw.&lt;br /&gt;
&lt;br /&gt;
For more info, check out &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasicuniversity.com/lb4help/BYREF.htm&quot; rel=&quot;nofollow&quot;&gt;BYREF&lt;/a&gt; in the help file.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:16:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Custom Controls in a Box (user:lbjoseph)-Utilizing the hyperlink&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:16 --&gt;Utilizing the hyperlink&lt;/h2&gt;
 Ok, so we have this great hyperlink custom control, but how do we use it? Well, it&#039;s really quite simple to use. All you have to do is look a little closer at the demo program.&lt;br /&gt;
&lt;br /&gt;
You already know how to make a hyperlink. Just assign a value like we did in the demo to the result of cCc.Hyperlink$(), with your own arguments.&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#i&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
As you know, the hyperlink function requires two events. The second event, what to do on mouse over, requires us to call the sub cC.RollHyperlink.&lt;br /&gt;
&lt;br /&gt;
So, once you have your events setup, all you have to do is call the cC.RollHyperlink sub from your mouse over event:&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#j&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Then, all you have to do is pass the handle to the link - in this case, it&#039;s Link1$.&lt;br /&gt;
&lt;br /&gt;
When you use a branch label event handler (like the example above) you must use the special variables &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasicuniversity.com/lb4help/LU_D_..htm&quot; rel=&quot;nofollow&quot;&gt;MouseX and MouseY&lt;/a&gt; for the mouse coordinates. Liberty BASIC always assigns the x and y position of the mouse into these special global variables.&lt;br /&gt;
&lt;br /&gt;
What if you chose to use a sub for an event handler? You would have to make the handle to your link global:&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#k&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
And your sub might look something like this:&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#l&quot;&gt;Click here for code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Notice the sub must accept three parameters. When Liberty BASIC calls a sub event for a graphicbox, it always passes the graphicbox handle, mouse x position, and mouse y position.&lt;br /&gt;
&lt;br /&gt;
As for the mouse click event, you can just put your own code in a sub or branch label. If you use a sub, be sure to put a receiver for the graphicbox handle, mouse x, and mouse y coordinates!&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:18:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Custom Controls in a Box (user:lbjoseph)-Conclusion and a Progress bar control&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:18 --&gt;Conclusion and a Progress bar control&lt;/h2&gt;
 Well, that&#039;s about it for the hyperlink. With the power of Liberty BASIC graphicboxes, you can create all kinds of custom controls.&lt;br /&gt;
&lt;br /&gt;
An example of a progressbar custom control can be found below. It&#039;s really quite simple, if you understand the principles discussed in this article.&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/ccbCode#m&quot;&gt;Click here for code.&lt;/a&gt;</description>
          </item>
    <item>
      <title>Graphicbox and Scrollbars</title>
      <link>https://lbpe.wikispaces.com/Graphicbox+and+Scrollbars</link>
      <dc:creator>RodBird</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/Graphicbox+and+Scrollbars</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/Graphicbox+and+Scrollbars</comments>
      <pubDate>Mon, 23 Nov 2015 12:06:55 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x-A Graphicbox with Scrollbars&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;A Graphicbox with Scrollbars&lt;/h2&gt;
 &lt;!-- ws:start:WikiTextUserlinkRule:09:[[user:janetterra]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/janetterra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/janetterra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;janetterra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/janetterra&quot; style=&quot;outline: none;&quot;&gt;janetterra&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:09 --&gt;&lt;!-- ws:start:WikiTextTocRule:27:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars&quot;&gt;A Graphicbox with Scrollbars&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-Horizscrollbar and Vertscrollbar&quot;&gt;Horizscrollbar and Vertscrollbar&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-A Graphics Window with Scrollbars&quot;&gt;A Graphics Window with Scrollbars&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-A Graphicbox with Scrollbars&quot;&gt;A Graphicbox with Scrollbars&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;!-- ws:start:WikiTextTocRule:32: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-A Word About the Actual size of the Graphicbox&quot;&gt;A Word About the Actual size of the Graphicbox&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:32 --&gt;&lt;!-- ws:start:WikiTextTocRule:33: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-Setting the Scrollbar min and max Parameters&quot;&gt;Setting the Scrollbar min and max Parameters&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:33 --&gt;&lt;!-- ws:start:WikiTextTocRule:34: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-Fixing a Glitch&quot;&gt;Fixing a Glitch&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:34 --&gt;&lt;!-- ws:start:WikiTextTocRule:35: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-Scrolling Within the Program&quot;&gt;Scrolling Within the Program&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:35 --&gt;&lt;!-- ws:start:WikiTextTocRule:36: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-Graphicbox and Scrollbars Demo&quot;&gt;Graphicbox and Scrollbars Demo&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:36 --&gt;&lt;!-- ws:start:WikiTextTocRule:37: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:37 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x-A Graphicbox with Scrollbars-Horizscrollbar and Vertscrollbar&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;Horizscrollbar and Vertscrollbar&lt;/h3&gt;
 &lt;br /&gt;
Liberty BASIC v4 gives us more control of the horizontal and vertical scrollbars of the Graphics window and even a Graphicbox. From the &lt;em&gt;What&#039;s New&lt;/em&gt; of the &lt;strong&gt;&lt;em&gt;Liberty BASIC v4 Help File&lt;/em&gt;&lt;/strong&gt; -&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;print #handle &amp;quot;horizscrollbar on/off [min max]&amp;quot;&lt;/li&gt;&lt;li&gt;This command manages the horizontal scrollbar. If the value is &amp;quot;on&amp;quot;, the scrollbar is made visible. If the value is &amp;quot;off&amp;quot;, the scrollbar is hidden. When turning on the scrollbar the optional parameters for min and max set the minimum and maximum scrollbar range in pixels (these parameters do nothing when turning the scrollbar off.) Without these parameters the default range is set to 0 and the width of the graphics view in pixels. A large scrollbar range allows the graphics window to scroll a long distance, while a short range allows it to scroll a short distance.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x-A Graphicbox with Scrollbars-A Graphics Window with Scrollbars&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;A Graphics Window with Scrollbars&lt;/h3&gt;
 &lt;br /&gt;
A window opened for Graphics contains scrollbars by default.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    Open &amp;amp;quot;A Graphics Window&amp;amp;quot; for Graphics as #1&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemo handle$&amp;lt;br/&amp;gt;        Close #1&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;        End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    Open &lt;span class=&quot;st0&quot;&gt;&amp;quot;A Graphics Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; Graphics &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
        Close #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;These scrollbars can be removed using the Vertscrollbar off and Horizscrollbar off commands.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    Open &amp;amp;quot;A Graphics Window&amp;amp;quot; for Graphics as #1&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Horizscrollbar Off&amp;amp;quot;&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Vertscrollbar Off&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemo handle$&amp;lt;br/&amp;gt;        Close #1&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;        End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    Open &lt;span class=&quot;st0&quot;&gt;&amp;quot;A Graphics Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; Graphics &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Horizscrollbar Off&amp;quot;&lt;/span&gt;
    #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Vertscrollbar Off&amp;quot;&lt;/span&gt;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
        Close #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x-A Graphicbox with Scrollbars-A Graphicbox with Scrollbars&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;A Graphicbox with Scrollbars&lt;/h3&gt;
 &lt;br /&gt;
Normally, a graphicbox opened within another window does not contain scrollbars. Scrollbars can be added with the Vertscrollbar On and Horizscrollbar On commands.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:69:&amp;lt;img src=&amp;quot;/file/view/sbars1.png/30354613/sbars1.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/sbars1.png/30354613/sbars1.png&quot; alt=&quot;sbars1.png&quot; title=&quot;sbars1.png&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:69 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    WindowWidth = 800&amp;lt;br/&amp;gt;    WindowHeight = 554&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Graphicbox #main.gb, 0, 0, 794, 320&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Graphicbox and Scrollbars&amp;amp;quot; for Window_nf as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Verdana 10 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Horizscrollbar On&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Vertscrollbar On&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Down; Color Darkblue&amp;amp;quot;&amp;lt;br/&amp;gt;    For x = 0 to 1550 Step 10&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Place &amp;amp;quot;;x;&amp;amp;quot; 10&amp;amp;quot;&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;North; Turn 180; Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;        If x / 100 = Int( x / 100 ) Then&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Place &amp;amp;quot;;x - 10;&amp;amp;quot; 40&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;\&amp;amp;quot;;x&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;    Next x&amp;lt;br/&amp;gt;    For y = 0 to 1500 Step 10&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Place 10 &amp;amp;quot;;y&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;North; Turn 90; Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;        If y / 100 = Int( y / 100 ) Then&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Place 30 &amp;amp;quot;;y + 5&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;\&amp;amp;quot;;y&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;    Next y&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Flush&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemo handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;        End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    Nomainwin
    WindowWidth &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;800&lt;/span&gt;
    WindowHeight &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;554&lt;/span&gt;
&amp;nbsp;
    UpperLeftX &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayWidth &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; WindowWidth&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    UpperLeftY &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayHeight &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; WindowHeight&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    Graphicbox #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;794&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;320&lt;/span&gt;
    Open &lt;span class=&quot;st0&quot;&gt;&amp;quot;Graphicbox and Scrollbars&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; Window_nf &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Verdana 10 Bold&amp;quot;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Horizscrollbar On&amp;quot;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Vertscrollbar On&amp;quot;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Down; Color Darkblue&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1550&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Step&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;x;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 10&amp;quot;&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;North; Turn 180; Go 10&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Go 10&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;x &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 40&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\&amp;quot;&lt;/span&gt;;x
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; x
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1500&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Step&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 10 &amp;quot;&lt;/span&gt;;y
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;North; Turn 90; Go 10&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Go 10&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 30 &amp;quot;&lt;/span&gt;;y &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\&amp;quot;&lt;/span&gt;;y
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; y
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Flush&amp;quot;&lt;/span&gt;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
        Close #main
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;x-A Graphicbox with Scrollbars-A Word About the Actual size of the Graphicbox&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;A Word About the Actual size of the Graphicbox&lt;/h3&gt;
 &lt;br /&gt;
The defined size of a graphicbox includes the graphicbox borders as well. This means that a 200 x 200 graphicbox can only display a 198 x 198 graphic. The display size is further compromised by the addition of scrollbars. Windows automatically subtracts the width of the scrollbar from the client area, so that painting on the client area does not run over the scrollbars. Increasing the width and height of the graphicbox by 20 pixels each should fully compensate for this loss. A 500 x 500 graphicbox with scrollbars has an approximate 480 x 480 display area.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;x-A Graphicbox with Scrollbars-Setting the Scrollbar min and max Parameters&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;Setting the Scrollbar min and max Parameters&lt;/h3&gt;
 &lt;br /&gt;
The Scrollbar commands support optional min and max parameters. By including these limits, the programmer can define the exact area to be scrolled. The min of both width and height is usually zero, but it can be any number, even a negative number. It is important to note that the max is not the actual final limit of the display. Rather, it is the Upper Left value. The size of the graphicbox (both width and height) extends this values. If the max width parameter is set to 500 for a graphicbox that is 400 pixels wide, the actual display area becomes approximately 880 pixels wide (900 pixels minus the scrollbar width). The same is true for the max height parameter.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    WindowWidth = 806&amp;lt;br/&amp;gt;    WindowHeight = 554&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Graphicbox #main.gb, 0, 0, 800, 320&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Graphicbox and Scrollbars&amp;amp;quot; for Window_nf as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Verdana 10 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Vertscrollbar On 0 500&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Horizscrollbar On 0 1000&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Down; Color Darkblue&amp;amp;quot;&amp;lt;br/&amp;gt;    For x = 0 to 1780 Step 10 &#039;1000 (max) + 800 (graphicbox width) - 20 = 1780&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Place &amp;amp;quot;;x;&amp;amp;quot; 10&amp;amp;quot;&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;North; Turn 180; Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;        If x / 100 = Int( x / 100 ) Then&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Place &amp;amp;quot;;x - 10;&amp;amp;quot; 40&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;\&amp;amp;quot;;x&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;    Next x&amp;lt;br/&amp;gt;    For y = 0 to 800 Step 10 &#039;500 (max) + 320 (graphicbox height) - 20 = 800&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Place 10 &amp;amp;quot;;y&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;North; Turn 90; Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;        If y / 100 = Int( y / 100 ) Then&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Place 30 &amp;amp;quot;;y + 5&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;\&amp;amp;quot;;y&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;    Next y&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Flush&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemo handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;        End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    Nomainwin
    WindowWidth &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;806&lt;/span&gt;
    WindowHeight &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;554&lt;/span&gt;
&amp;nbsp;
    UpperLeftX &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayWidth &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; WindowWidth&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    UpperLeftY &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayHeight &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; WindowHeight&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    Graphicbox #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;800&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;320&lt;/span&gt;
    Open &lt;span class=&quot;st0&quot;&gt;&amp;quot;Graphicbox and Scrollbars&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; Window_nf &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Verdana 10 Bold&amp;quot;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Vertscrollbar On 0 500&amp;quot;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Horizscrollbar On 0 1000&amp;quot;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Down; Color Darkblue&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1780&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Step&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;1000 (max) + 800 (graphicbox width) - 20 = 1780&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;x;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 10&amp;quot;&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;North; Turn 180; Go 10&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Go 10&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;x &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 40&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\&amp;quot;&lt;/span&gt;;x
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; x
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;800&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Step&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;500 (max) + 320 (graphicbox height) - 20 = 800&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 10 &amp;quot;&lt;/span&gt;;y
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;North; Turn 90; Go 10&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Go 10&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 30 &amp;quot;&lt;/span&gt;;y &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\&amp;quot;&lt;/span&gt;;y
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; y
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Flush&amp;quot;&lt;/span&gt;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
        Close #main
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;x-A Graphicbox with Scrollbars-Fixing a Glitch&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;Fixing a Glitch&lt;/h3&gt;
 &lt;br /&gt;
As the scrolled area becomes greater, a known glitch will appear with the graphics. The graphics at lower and/or rightmost become distorted.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:70:&amp;lt;img src=&amp;quot;/file/view/sbars2.png/30354614/sbars2.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/sbars2.png/30354614/sbars2.png&quot; alt=&quot;sbars2.png&quot; title=&quot;sbars2.png&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:70 --&gt;&lt;br /&gt;
&lt;br /&gt;
The following code shows this glitch. Run the code and then scroll all the way down and then all the way to the right.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    WindowWidth = 806&amp;lt;br/&amp;gt;    WindowHeight = 554&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Graphicbox #main.gb, 0, 0, 800, 320&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Graphicbox and Scrollbars&amp;amp;quot; for Window_nf as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Verdana 10 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Horizscrollbar On 0 2000&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Vertscrollbar On 0 1000&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Down; Color Darkblue&amp;amp;quot;&amp;lt;br/&amp;gt;&#039;    #main.gb &amp;amp;quot;Place -20, -20; Boxfilled 2800 1320&amp;amp;quot;&amp;lt;br/&amp;gt;    For x = 0 to 2780 Step 10 &#039;2000 (max) + 800 (graphicbox width) - 20 = 1780&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Place &amp;amp;quot;;x;&amp;amp;quot; 10&amp;amp;quot;&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;North; Turn 180; Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;        If x / 100 = Int( x / 100 ) Then&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Place &amp;amp;quot;;x - 10;&amp;amp;quot; 40&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;\&amp;amp;quot;;x&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;    Next x&amp;lt;br/&amp;gt;    For y = 0 to 1300 Step 10 &#039;1000 (max) + 320 (graphicbox height) - 20 = 1300&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Place 10 &amp;amp;quot;;y&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;North; Turn 90; Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;        If y / 100 = Int( y / 100 ) Then&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Place 30 &amp;amp;quot;;y + 5&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;\&amp;amp;quot;;y&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;    Next y&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Flush&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemo handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;        End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    Nomainwin
    WindowWidth &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;806&lt;/span&gt;
    WindowHeight &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;554&lt;/span&gt;
&amp;nbsp;
    UpperLeftX &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayWidth &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; WindowWidth&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    UpperLeftY &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayHeight &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; WindowHeight&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    Graphicbox #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;800&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;320&lt;/span&gt;
    Open &lt;span class=&quot;st0&quot;&gt;&amp;quot;Graphicbox and Scrollbars&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; Window_nf &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Verdana 10 Bold&amp;quot;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Horizscrollbar On 0 2000&amp;quot;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Vertscrollbar On 0 1000&amp;quot;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Down; Color Darkblue&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;    #main.gb &amp;quot;Place -20, -20; Boxfilled 2800 1320&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2780&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Step&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;2000 (max) + 800 (graphicbox width) - 20 = 1780&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;x;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 10&amp;quot;&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;North; Turn 180; Go 10&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Go 10&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;x &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 40&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\&amp;quot;&lt;/span&gt;;x
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; x
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1300&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Step&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;1000 (max) + 320 (graphicbox height) - 20 = 1300&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 10 &amp;quot;&lt;/span&gt;;y
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;North; Turn 90; Go 10&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Go 10&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 30 &amp;quot;&lt;/span&gt;;y &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\&amp;quot;&lt;/span&gt;;y
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; y
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Flush&amp;quot;&lt;/span&gt;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
        Close #main
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;The fix? Uncomment the line&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;&#039;    #main.gb &amp;amp;quot;Place -20, -20; Boxfilled 2800 1320&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039;    #main.gb &amp;quot;Place -20, -20; Boxfilled 2800 1320&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;and try the code again. The graphics now flush and persist properly. The filled box should fully extend beyond the borders of the desired visible scrolled area to be effective. Note that if you ever issue a CLS command you will need to reissue the above boxfilled instruction to continue to avoid distortion.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:23:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc7&quot;&gt;&lt;a name=&quot;x-A Graphicbox with Scrollbars-Scrolling Within the Program&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:23 --&gt;Scrolling Within the Program&lt;/h3&gt;
 &lt;br /&gt;
The API call &amp;quot;SetScrollPos&amp;quot; allows the programmer to set the scrollbar positions. Pass Windows constants to the call to define the scrollbar (horizontal or vertical) and the amount to scroll. The position is the position of the Upper Left Corner. Some Windows constants include&lt;br /&gt;
&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;_SBS_HORZ &#039; Designates the Horizontal Scrollbar&lt;/li&gt;&lt;li&gt;_WM_HSCROLL &#039; Windows Message to the Horizontal Scrollbar&lt;/li&gt;&lt;li&gt;_SBS_VERT &#039; Designates the Vertical Scrollbar&lt;/li&gt;&lt;li&gt;_WM_VSCROLL &#039; Windows Message to the Vertical Scrollbar&lt;/li&gt;&lt;li&gt;_SB_THUMBPOSITION &#039; The Value Within the Range of the Scroll Limits&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Setting the Scrollbar position requires first designating the Scrollbar to be set, then defining the desired position, and lastly posting that message to the scrollbar.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    CallDLL #user32, &amp;amp;quot;SetScrollPos&amp;amp;quot;, _&amp;lt;br/&amp;gt;        handle as Ulong, _ &#039;handle of the graphicbox&amp;lt;br/&amp;gt;        scrollDir as Long, _ &#039;_SBS_HORZ or _SBS_VERT&amp;lt;br/&amp;gt;        pos as Long, _ &#039;Desired Position&amp;lt;br/&amp;gt;        1 as long, _ &#039;Flag to Repaint the Scrollbar Control&amp;lt;br/&amp;gt;        result as Long &#039;Returned Value&amp;lt;br/&amp;gt;&#039;The position must then be multiplied by &amp;amp;amp;H10000 and added to _SB_THUMBPOSITION&amp;lt;br/&amp;gt;        hPos = pos * HexDec(&amp;amp;quot;&amp;amp;amp;H10000&amp;amp;quot;) + _SB_THUMBPOSITION&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;PostMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;        handle as Ulong, _ &#039;handle of the Graphicbox&amp;lt;br/&amp;gt;        scrollFlag as Long, _ &#039;_WM_HSCROLL or _WM_VSCROLL&amp;lt;br/&amp;gt;            hPos as Long, _ &#039;Position in hexadecimal + H10000&amp;lt;br/&amp;gt;            0 as Long, _ &#039;No significance&amp;lt;br/&amp;gt;            result as long &#039;Returned Value&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SetScrollPos&amp;quot;&lt;/span&gt;, _
        handle &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;handle of the graphicbox&lt;/span&gt;
        scrollDir &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;_SBS_HORZ or _SBS_VERT&lt;/span&gt;
        pos &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;Desired Position&lt;/span&gt;
        &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;Flag to Repaint the Scrollbar Control&lt;/span&gt;
        result &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;Returned Value&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;The position must then be multiplied by &amp;amp;H10000 and added to _SB_THUMBPOSITION&lt;/span&gt;
        hPos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; pos &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt; HexDec&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;amp;H10000&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _SB_THUMBPOSITION
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;PostMessageA&amp;quot;&lt;/span&gt;, _
        handle &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;handle of the Graphicbox&lt;/span&gt;
        scrollFlag &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;_WM_HSCROLL or _WM_VSCROLL&lt;/span&gt;
            hPos &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;Position in hexadecimal + H10000&lt;/span&gt;
            &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;No significance&lt;/span&gt;
            result &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;Returned Value&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;The API call &amp;quot;GetScrollPos&amp;quot; returns the current position of the Scrollbar.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    CallDLL #user32, &amp;amp;quot;GetScrollPos&amp;amp;quot;, _&amp;lt;br/&amp;gt;        handle As Ulong, _ &#039;handle of the Graphicbox&amp;lt;br/&amp;gt;        scrollDir as Long, _ &#039;_SBS_HORZ or _SBS_VERT&amp;lt;br/&amp;gt;        resultPos as Long &#039;The Position in decimal format&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;GetScrollPos&amp;quot;&lt;/span&gt;, _
        handle &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;handle of the Graphicbox&lt;/span&gt;
        scrollDir &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;_SBS_HORZ or _SBS_VERT&lt;/span&gt;
        resultPos &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;The Position in decimal format&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:25:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc8&quot;&gt;&lt;a name=&quot;x-A Graphicbox with Scrollbars-Graphicbox and Scrollbars Demo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:25 --&gt;Graphicbox and Scrollbars Demo&lt;/h3&gt;
 &lt;br /&gt;
Copy and paste the following demo to your favorite Liberty BASIC IDE. No external files are required.&lt;br /&gt;
&lt;!-- ws:start:WikiTextTocRule:38:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:38 --&gt;&lt;!-- ws:start:WikiTextTocRule:39: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars&quot;&gt;A Graphicbox with Scrollbars&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:39 --&gt;&lt;!-- ws:start:WikiTextTocRule:40: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-Horizscrollbar and Vertscrollbar&quot;&gt;Horizscrollbar and Vertscrollbar&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:40 --&gt;&lt;!-- ws:start:WikiTextTocRule:41: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-A Graphics Window with Scrollbars&quot;&gt;A Graphics Window with Scrollbars&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:41 --&gt;&lt;!-- ws:start:WikiTextTocRule:42: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-A Graphicbox with Scrollbars&quot;&gt;A Graphicbox with Scrollbars&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:42 --&gt;&lt;!-- ws:start:WikiTextTocRule:43: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-A Word About the Actual size of the Graphicbox&quot;&gt;A Word About the Actual size of the Graphicbox&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:43 --&gt;&lt;!-- ws:start:WikiTextTocRule:44: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-Setting the Scrollbar min and max Parameters&quot;&gt;Setting the Scrollbar min and max Parameters&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:44 --&gt;&lt;!-- ws:start:WikiTextTocRule:45: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-Fixing a Glitch&quot;&gt;Fixing a Glitch&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:45 --&gt;&lt;!-- ws:start:WikiTextTocRule:46: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-Scrolling Within the Program&quot;&gt;Scrolling Within the Program&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:46 --&gt;&lt;!-- ws:start:WikiTextTocRule:47: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-A Graphicbox with Scrollbars-Graphicbox and Scrollbars Demo&quot;&gt;Graphicbox and Scrollbars Demo&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:47 --&gt;&lt;!-- ws:start:WikiTextTocRule:48: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:48 --&gt;&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    WindowWidth = 800&amp;lt;br/&amp;gt;    WindowHeight = 554&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Graphicbox #main.gb, 0, 0, 520, 520&amp;lt;br/&amp;gt;    Button #main.b1, &amp;amp;quot;Scroll Left Most&amp;amp;quot;, ScrollButtonSet, UL, 560, 50, 180, 40&amp;lt;br/&amp;gt;    Button #main.b2, &amp;amp;quot;Scroll Right Most&amp;amp;quot;, ScrollButtonSet, UL, 560, 100, 180, 40&amp;lt;br/&amp;gt;    Button #main.b3, &amp;amp;quot;Scroll To Top&amp;amp;quot;, ScrollButtonSet, UL, 560, 150, 180, 40&amp;lt;br/&amp;gt;    Button #main.b4, &amp;amp;quot;Scroll To Bottom&amp;amp;quot;, ScrollButtonSet, UL, 560, 200, 180, 40&amp;lt;br/&amp;gt;    Button #main.b5, &amp;amp;quot;HScroll &amp;amp;#45;-&amp;amp;gt; &amp;amp;quot;, ScrollButtonSet, UL, 560, 250, 120, 40&amp;lt;br/&amp;gt;    Textbox #main.tb5, 690, 255, 50, 30&amp;lt;br/&amp;gt;    Button #main.b6, &amp;amp;quot;VScroll &amp;amp;#45;-&amp;amp;gt; &amp;amp;quot;, ScrollButtonSet, UL, 560, 300, 120, 40&amp;lt;br/&amp;gt;    Textbox #main.tb6, 690, 305, 50, 30&amp;lt;br/&amp;gt;    Stylebits #main.b7, _BS_MULTILINE, 0, 0, 0&amp;lt;br/&amp;gt;    Button #main.b7, &amp;amp;quot;Horizontal Thumbposition&amp;amp;quot;, ScrollButtonGet, UL, 560, 370, 120, 40&amp;lt;br/&amp;gt;    Statictext #main.st7, &amp;amp;quot;0&amp;amp;quot;, 690, 380, 50, 30&amp;lt;br/&amp;gt;    Stylebits #main.b8, _BS_MULTILINE, 0, 0, 0&amp;lt;br/&amp;gt;    Button #main.b8, &amp;amp;quot;Vertical Thumbposition&amp;amp;quot;, ScrollButtonGet, UL, 560, 420, 120, 40&amp;lt;br/&amp;gt;    Statictext #main.st8, &amp;amp;quot;0&amp;amp;quot;, 690, 430, 50, 30&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Graphicbox and Scrollbars&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Verdana 10 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Vertscrollbar On 0 500&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Horizscrollbar On 0 500&amp;amp;quot; &#039;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Down; Fill Darkblue; Color Lightgray; Backcolor Darkblue&amp;amp;quot;&amp;lt;br/&amp;gt;    For x = 0 to 1000 Step 10&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Place &amp;amp;quot;;x;&amp;amp;quot; 10&amp;amp;quot;&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;North; Turn 180; Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;        If x / 100 = Int( x / 100 ) Then&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Place &amp;amp;quot;;x - 10;&amp;amp;quot; 20&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;\&amp;amp;quot;;x&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;    Next x&amp;lt;br/&amp;gt;    For y = 0 to 1000 Step 10&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Place 10 &amp;amp;quot;;y&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;North; Turn 90; Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;        If y / 100 = Int( y / 100 ) Then&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Go 10&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;Place 30 &amp;amp;quot;;y + 5&amp;lt;br/&amp;gt;            #main.gb &amp;amp;quot;\&amp;amp;quot;;y&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;    Next y&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Flush&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemo handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;        End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub ScrollButtonSet handle$&amp;lt;br/&amp;gt;        nExtension$ = Right$(handle$, 1)&amp;lt;br/&amp;gt;        Select Case Val(nExtension$)&amp;lt;br/&amp;gt;            Case 1&amp;lt;br/&amp;gt;                pos = 0&amp;lt;br/&amp;gt;                scrollDir = _SBS_HORZ&amp;lt;br/&amp;gt;                scrollFlag = _WM_HSCROLL&amp;lt;br/&amp;gt;            Case 2&amp;lt;br/&amp;gt;                pos = 500&amp;lt;br/&amp;gt;                scrollDir = _SBS_HORZ&amp;lt;br/&amp;gt;                scrollFlag = _WM_HSCROLL&amp;lt;br/&amp;gt;            Case 3&amp;lt;br/&amp;gt;                pos = 0&amp;lt;br/&amp;gt;                scrollDir = _SBS_VERT&amp;lt;br/&amp;gt;                scrollFlag = _WM_VSCROLL&amp;lt;br/&amp;gt;            Case 4&amp;lt;br/&amp;gt;                pos = 500&amp;lt;br/&amp;gt;                scrollDir = _SBS_VERT&amp;lt;br/&amp;gt;                scrollFlag = _WM_VSCROLL&amp;lt;br/&amp;gt;            Case 5&amp;lt;br/&amp;gt;                #main.tb5, &amp;amp;quot;!Contents? pos$&amp;amp;quot;&amp;lt;br/&amp;gt;                pos = Val(pos$)&amp;lt;br/&amp;gt;                scrollDir = _SBS_HORZ&amp;lt;br/&amp;gt;                scrollFlag = _WM_HSCROLL&amp;lt;br/&amp;gt;            Case 6&amp;lt;br/&amp;gt;                #main.tb6, &amp;amp;quot;!Contents? pos$&amp;amp;quot;&amp;lt;br/&amp;gt;                pos = Val(pos$)&amp;lt;br/&amp;gt;                scrollDir = _SBS_VERT&amp;lt;br/&amp;gt;                scrollFlag = _WM_VSCROLL&amp;lt;br/&amp;gt;        End Select&amp;lt;br/&amp;gt;        Call SetScrollPos hWnd(#main.gb), pos, scrollDir, scrollFlag&amp;lt;br/&amp;gt;        End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub ScrollButtonGet handle$&amp;lt;br/&amp;gt;        nExtension$ = Right$(handle$, 1)&amp;lt;br/&amp;gt;        Select Case Val(nExtension$)&amp;lt;br/&amp;gt;            Case 7&amp;lt;br/&amp;gt;                scrollDir = _SBS_HORZ&amp;lt;br/&amp;gt;            Case 8&amp;lt;br/&amp;gt;                scrollDir = _SBS_VERT&amp;lt;br/&amp;gt;        End Select&amp;lt;br/&amp;gt;        pos = GetScrollPos(hWnd(#main.gb), scrollDir)&amp;lt;br/&amp;gt;        handle$ = &amp;amp;quot;#main.st&amp;amp;quot;;nExtension$&amp;lt;br/&amp;gt;        #handle$ pos&amp;lt;br/&amp;gt;        End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub SetScrollPos handle, pos, scrollDir, scrollFlag&amp;lt;br/&amp;gt;        CallDLL #user32, &amp;amp;quot;SetScrollPos&amp;amp;quot;, _&amp;lt;br/&amp;gt;            handle as Ulong, _&amp;lt;br/&amp;gt;            scrollDir as Long, _&amp;lt;br/&amp;gt;            pos as Long, _&amp;lt;br/&amp;gt;            1 as long, _&amp;lt;br/&amp;gt;            result as Long&amp;lt;br/&amp;gt;            hPos = pos * HexDec(&amp;amp;quot;&amp;amp;amp;H10000&amp;amp;quot;) + _SB_THUMBPOSITION&amp;lt;br/&amp;gt;        CallDLL #user32, &amp;amp;quot;PostMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;            handle as Ulong, _&amp;lt;br/&amp;gt;            scrollFlag as Long, _&amp;lt;br/&amp;gt;            hPos as Long, _&amp;lt;br/&amp;gt;            0 as Long, _&amp;lt;br/&amp;gt;            result as long&amp;lt;br/&amp;gt;        End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Function GetScrollPos(handle, scrollDir)&amp;lt;br/&amp;gt;        CallDLL #user32, &amp;amp;quot;GetScrollPos&amp;amp;quot;, _&amp;lt;br/&amp;gt;            handle As Ulong, _&amp;lt;br/&amp;gt;            scrollDir as Long, _&amp;lt;br/&amp;gt;            GetScrollPos as Long&amp;lt;br/&amp;gt;        End Function&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    Nomainwin
    WindowWidth &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;800&lt;/span&gt;
    WindowHeight &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;554&lt;/span&gt;
&amp;nbsp;
    UpperLeftX &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayWidth &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; WindowWidth&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    UpperLeftY &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayHeight &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; WindowHeight&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    Graphicbox #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;520&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;520&lt;/span&gt;
    Button #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b1&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Scroll Left Most&amp;quot;&lt;/span&gt;, ScrollButtonSet, UL, &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    Button #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b2&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Scroll Right Most&amp;quot;&lt;/span&gt;, ScrollButtonSet, UL, &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    Button #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b3&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Scroll To Top&amp;quot;&lt;/span&gt;, ScrollButtonSet, UL, &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    Button #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b4&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Scroll To Bottom&amp;quot;&lt;/span&gt;, ScrollButtonSet, UL, &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    Button #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b5&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;HScroll --&amp;gt; &amp;quot;&lt;/span&gt;, ScrollButtonSet, UL, &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;250&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    Textbox #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;690&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;255&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    Button #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b6&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;VScroll --&amp;gt; &amp;quot;&lt;/span&gt;, ScrollButtonSet, UL, &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;300&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    Textbox #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;690&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;305&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    Stylebits #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b7&lt;/span&gt;, _BS_MULTILINE, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    Button #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b7&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Horizontal Thumbposition&amp;quot;&lt;/span&gt;, ScrollButtonGet, UL, &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;370&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    Statictext #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;st7&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;690&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;380&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    Stylebits #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b8&lt;/span&gt;, _BS_MULTILINE, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    Button #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b8&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Vertical Thumbposition&amp;quot;&lt;/span&gt;, ScrollButtonGet, UL, &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;420&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    Statictext #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;st8&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;690&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;430&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    Open &lt;span class=&quot;st0&quot;&gt;&amp;quot;Graphicbox and Scrollbars&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Verdana 10 Bold&amp;quot;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Vertscrollbar On 0 500&amp;quot;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Horizscrollbar On 0 500&amp;quot;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Down; Fill Darkblue; Color Lightgray; Backcolor Darkblue&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1000&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Step&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;x;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 10&amp;quot;&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;North; Turn 180; Go 10&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Go 10&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;x &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 20&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\&amp;quot;&lt;/span&gt;;x
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; x
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1000&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Step&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 10 &amp;quot;&lt;/span&gt;;y
        #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;North; Turn 90; Go 10&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; y &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Go 10&amp;quot;&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 30 &amp;quot;&lt;/span&gt;;y &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;
            #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;\&amp;quot;&lt;/span&gt;;y
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; y
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Flush&amp;quot;&lt;/span&gt;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
        Close #main
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; ScrollButtonSet handle$
        nExtension$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Right$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;handle$, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;nExtension$&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
                pos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
                scrollDir &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _SBS_HORZ
                scrollFlag &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _WM_HSCROLL
            &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
                pos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;500&lt;/span&gt;
                scrollDir &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _SBS_HORZ
                scrollFlag &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _WM_HSCROLL
            &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;
                pos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
                scrollDir &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _SBS_VERT
                scrollFlag &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _WM_VSCROLL
            &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;
                pos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;500&lt;/span&gt;
                scrollDir &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _SBS_VERT
                scrollFlag &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _WM_VSCROLL
            &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;
                #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb5&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? pos$&amp;quot;&lt;/span&gt;
                pos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;pos$&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                scrollDir &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _SBS_HORZ
                scrollFlag &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _WM_HSCROLL
            &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;
                #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb6&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? pos$&amp;quot;&lt;/span&gt;
                pos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;pos$&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                scrollDir &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _SBS_VERT
                scrollFlag &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _WM_VSCROLL
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; SetScrollPos hWnd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;#main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pos, scrollDir, scrollFlag
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; ScrollButtonGet handle$
        nExtension$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Right$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;handle$, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Val&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;nExtension$&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;
                scrollDir &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _SBS_HORZ
            &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;
                scrollDir &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; _SBS_VERT
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;
        pos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; GetScrollPos&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hWnd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;#main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;gb&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, scrollDir&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        handle$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;#main.st&amp;quot;&lt;/span&gt;;nExtension$
        #handle$ pos
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; SetScrollPos handle, pos, scrollDir, scrollFlag
        CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SetScrollPos&amp;quot;&lt;/span&gt;, _
            handle &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _
            scrollDir &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
            pos &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
            &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;long&lt;/span&gt;, _
            result &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;
            hPos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; pos &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt; HexDec&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;amp;H10000&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _SB_THUMBPOSITION
        CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;PostMessageA&amp;quot;&lt;/span&gt;, _
            handle &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _
            scrollFlag &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
            hPos &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
            &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
            result &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;long&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; GetScrollPos&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;handle, scrollDir&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;GetScrollPos&amp;quot;&lt;/span&gt;, _
            handle &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _
            scrollDir &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
            GetScrollPos &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
This article first appeared in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://babek.info/libertybasicfiles/lbnews/nl139/home.htm&quot; rel=&quot;nofollow&quot;&gt;Issue #139 (December 2005)&lt;/a&gt; of the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://babek.info/libertybasicfiles/lbnews/&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC Newsletter&lt;/a&gt;.</description>
          </item>
    <item>
      <title>gui</title>
      <link>https://lbpe.wikispaces.com/gui</link>
      <dc:creator>Alyce</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/gui</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/gui</comments>
      <pubDate>Mon, 24 Oct 2011 13:49:21 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:0:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;GUI Programming&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:0 --&gt;GUI Programming&lt;/h1&gt;
 Using Windows, Controls and Dialogs&lt;br /&gt;
&lt;!-- ws:start:WikiTextTocRule:20:&amp;lt;img id=&amp;quot;wikitext@@toc@@flat&amp;quot; class=&amp;quot;WikiMedia WikiMediaTocFlat&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/flat?w=100&amp;amp;h=16&amp;quot;/&amp;gt; --&gt;&lt;!-- ws:end:WikiTextTocRule:20 --&gt;&lt;!-- ws:start:WikiTextTocRule:21: --&gt;&lt;a href=&quot;#GUI Programming&quot;&gt;GUI Programming&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextTocRule:22: --&gt; | &lt;a href=&quot;#Windows&quot;&gt;Windows&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;!-- ws:start:WikiTextTocRule:23: --&gt; | &lt;a href=&quot;#Menus&quot;&gt;Menus&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt; | &lt;a href=&quot;#Controls&quot;&gt;Controls&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt; | &lt;a href=&quot;#Buttons&quot;&gt;Buttons&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt; | &lt;a href=&quot;#Textboxes&quot;&gt;Textboxes&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt;&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt; | &lt;a href=&quot;#Graphics Windows and Graphicboxes&quot;&gt;Graphics Windows and Graphicboxes&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt; | &lt;a href=&quot;#Stylebits&quot;&gt;Stylebits&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:2:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Windows&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:2 --&gt;Windows&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/LayeredWindowTransparency&quot;&gt;Transparent Window Using SetLayeredWindowAttributes&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:00:[[user:JanetTerra|1154656496]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;Aug 3, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:00 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/WindowCoordinates&quot;&gt;Getting a Window&#039;s Coordinates&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:01:[[user:Alyce|1168275729]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/Alyce-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Alyce&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;Alyce&lt;/a&gt; &lt;small&gt;Jan 8, 2007&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:01 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/MoveWindow&quot;&gt;Moving or Resizing a Window or Control&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:02:[[user:Alyce|1170078813]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/Alyce-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Alyce&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;Alyce&lt;/a&gt; &lt;small&gt;Jan 29, 2007&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:02 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/GetSysColor&quot;&gt;GetSysColor: Designing Your Program With GUI Compatible Colors&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:03:[[user:JanetTerra|1170351850]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;Feb 1, 2007&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:03 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Managing%20Multiple%20Windows&quot;&gt;Managing Multiple Windows&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:04:[[user:harmonv]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/harmonv&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/harmonv-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;harmonv&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/harmonv&quot; style=&quot;outline: none;&quot;&gt;harmonv&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:04 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AnimatedWindow&quot;&gt;AnimateWindow&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:05:[[user:JanetTerra|1200356986]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;Jan 14, 2008&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:05 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/ChangingTheIcon&quot;&gt;ChangingTheIcon&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:06:[[user:Alyce|1301607392]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/Alyce-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Alyce&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;Alyce&lt;/a&gt; &lt;small&gt;Mar 31, 2011&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:06 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/MDIScroll&quot;&gt;MDI Client Window to Scroll Controls&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:07:[[user:Alyce|1319464002]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/Alyce-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Alyce&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;Alyce&lt;/a&gt; &lt;small&gt;Oct 24, 2011&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:07 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:4:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Menus&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:4 --&gt;Menus&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/menus01&quot;&gt;The Liberty BASIC Menu Bar&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:08:[[user:JanetTerra|1159124837]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;Sep 24, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:08 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/menus02&quot;&gt;The Liberty BASIC Popup Menu&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:09:[[user:JanetTerra|1159153381]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;Sep 24, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:09 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Understanding%20Cascading%20Menus&quot;&gt;Understanding Cascading Menus&lt;/a&gt; Jim Brossman&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:6:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Controls&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:6 --&gt;Controls&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/ColorStatementsForControls&quot;&gt;Color Statements for Controls&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:010:[[user:Alyce]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/Alyce-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Alyce&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;Alyce&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:010 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:8:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Buttons&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:8 --&gt;Buttons&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/PushButtons&quot;&gt;Push Buttons&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:011:[[user:Alyce]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/Alyce-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Alyce&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;Alyce&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:011 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Improved%20BmpButton&quot;&gt;Improved BmpButton&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:012:[[user:Alyce|1168865275]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/Alyce-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Alyce&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;Alyce&lt;/a&gt; &lt;small&gt;Jan 15, 2007&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:012 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BmpButtons&quot;&gt;BmpButtons&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:013:[[user:Alyce]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/Alyce-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Alyce&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;Alyce&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:013 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:10:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Textboxes&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:10 --&gt;Textboxes&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Textbox%20with%20Columns&quot;&gt;Creating Columns in a Textbox with _EM_SETTABSTOPS&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:014:[[user:JanetTerra|1170741122]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;Feb 5, 2007&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:014 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Retrieving%20Information%20from%20Textboxes&quot;&gt;Retrieving Information from Textboxes with SendMessageA&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:015:[[user:JanetTerra|1171090037]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;Feb 9, 2007&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:015 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:12:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Textboxes-Listboxes&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:12 --&gt;Listboxes&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/ListBox_single_and_double_click&quot;&gt;How to have a single- and a double-click handler for a listbox&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:016:[[user:StPendl|1189413915]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/StPendl&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/StPendl-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StPendl&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/StPendl&quot; style=&quot;outline: none;&quot;&gt;StPendl&lt;/a&gt; &lt;small&gt;Sep 10, 2007&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:016 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/ListBoxAndButtons&quot;&gt;Rearranging a listbox and repeating buttons&lt;/a&gt; - by Jim Brossman&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:14:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Graphics Windows and Graphicboxes&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:14 --&gt;Graphics Windows and Graphicboxes&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Graphics%20Windows%20Graphicboxes%20and%20Scrollbars&quot;&gt;Graphics Windows, Graphicboxes and Scrollbars&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:017:[[user:JanetTerra|1148261403]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;May 21, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:017 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Graphicbox%20and%20Scrollbars&quot;&gt;A Graphicbox with Scrollbars&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:018:[[user:JanetTerra|1170604470]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;Feb 4, 2007&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:018 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/CustomControlsBox&quot;&gt;Custom Controls in a Box&lt;/a&gt; - &lt;!-- ws:start:WikiTextUserlinkRule:019:[[user:lbjoseph]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/lbjoseph&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/lbjoseph-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;lbjoseph&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/lbjoseph&quot; style=&quot;outline: none;&quot;&gt;lbjoseph&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:019 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:16:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:16 --&gt;Stylebits&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/StylebitsWindowsConstants&quot;&gt;Stylebits and Windows Constants&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:020:[[user:JanetTerra|1154545919]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;Aug 2, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:020 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Windows&quot;&gt;Stylebits - Windows&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:021:[[user:JanetTerra|1147218418]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;May 9, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:021 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Textboxes&quot;&gt;Stylebits - Textboxes&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:022:[[user:JanetTerra|1147222239]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;May 9, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:022 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Statictext&quot;&gt;Stylebits - Statictext&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:023:[[user:JanetTerra|1147306641]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;May 10, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:023 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Buttons&quot;&gt;Stylebits - Buttons&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:024:[[user:JanetTerra|1147400893]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;May 11, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:024 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Listboxes&quot;&gt;Stylebits - Listboxes&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:025:[[user:JanetTerra|1147914429]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;May 17, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:025 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Comboboxes&quot;&gt;Stylebits - Comboboxes&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:026:[[user:JanetTerra|1147922597]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;May 17, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:026 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Toggle%20Buttons&quot;&gt;Stylebits - Toggle Buttons&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:027:[[user:JanetTerra|1148082925]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;May 19, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:027 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Dialog%20Windows&quot;&gt;Stylebits - Dialog Windows&lt;/a&gt; &lt;!-- ws:start:WikiTextUserlinkRule:028:[[user:JanetTerra|1148179079]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt; &lt;small&gt;May 20, 2006&lt;/small&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:028 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;u&gt;Stylebits - Texteditor&lt;/u&gt; (this is an internal widget of LB, so there are no styles available)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:18:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Stylebits-Windows References on the Microsoft Developer Network Library&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:18 --&gt;Windows References on the Microsoft Developer Network Library&lt;/h2&gt;
&lt;em&gt;The following links take you to the Microsoft documentation for Windows. The articles in this list are not part of the Liberty BASIC Programmer&#039;s Encyclopedia, and they are not specific to the Liberty BASIC language .&lt;/em&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632595.aspx&quot; rel=&quot;nofollow&quot;&gt;Window Reference on MSDN&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb773173.aspx&quot; rel=&quot;nofollow&quot;&gt;Control Reference on MSDN&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb775943(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;Button Reference on MSDN&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb775458(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;Textbox Reference on MSDN&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb775146(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;Listbox Reference on MSDN&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;strong&gt;List Categories Here&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;list articles here&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;
&lt;!-- ws:start:WikiTextTocRule:32:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:32 --&gt;&lt;!-- ws:start:WikiTextTocRule:33: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#GUI Programming&quot;&gt;GUI Programming&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:33 --&gt;&lt;!-- ws:start:WikiTextTocRule:34: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Windows&quot;&gt;Windows&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:34 --&gt;&lt;!-- ws:start:WikiTextTocRule:35: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Menus&quot;&gt;Menus&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:35 --&gt;&lt;!-- ws:start:WikiTextTocRule:36: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Controls&quot;&gt;Controls&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:36 --&gt;&lt;!-- ws:start:WikiTextTocRule:37: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Buttons&quot;&gt;Buttons&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:37 --&gt;&lt;!-- ws:start:WikiTextTocRule:38: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Textboxes&quot;&gt;Textboxes&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:38 --&gt;&lt;!-- ws:start:WikiTextTocRule:39: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Textboxes-Listboxes&quot;&gt;Listboxes&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:39 --&gt;&lt;!-- ws:start:WikiTextTocRule:40: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Graphics Windows and Graphicboxes&quot;&gt;Graphics Windows and Graphicboxes&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:40 --&gt;&lt;!-- ws:start:WikiTextTocRule:41: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Stylebits&quot;&gt;Stylebits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:41 --&gt;&lt;!-- ws:start:WikiTextTocRule:42: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Stylebits-Windows References on the Microsoft Developer Network Library&quot;&gt;Windows References on the Microsoft Developer Network Library&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:42 --&gt;&lt;!-- ws:start:WikiTextTocRule:43: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:43 --&gt;</description>
          </item>
    <item>
      <title>Improved BmpButton</title>
      <link>https://lbpe.wikispaces.com/Improved+BmpButton</link>
      <dc:creator>Alyce</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/Improved+BmpButton</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/Improved+BmpButton</comments>
      <pubDate>Sat, 24 Jul 2010 20:16:05 GMT</pubDate>
      <description>&lt;strong&gt;Why Create BmpButtons?&lt;/strong&gt;&lt;br /&gt;
Liberty BASIC has easy, native BmpButtons. The alternate method described here is useful because the appearance of Liberty BASIC BmpButtons does not suit everybody.&lt;br /&gt;
&lt;br /&gt;
BmpButtons look like this when they are not being clicked:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:6:&amp;lt;img src=&amp;quot;/file/view/bmpbutton.gif/30318503/bmpbutton.gif&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/bmpbutton.gif/30318503/bmpbutton.gif&quot; alt=&quot;bmpbutton.gif&quot; title=&quot;bmpbutton.gif&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:6 --&gt;&lt;br /&gt;
&lt;br /&gt;
Windows BmpButtons look like they are pushed down when the user clicks on them:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:7:&amp;lt;img src=&amp;quot;/file/view/depressed.gif/30318505/depressed.gif&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/depressed.gif/30318505/depressed.gif&quot; alt=&quot;depressed.gif&quot; title=&quot;depressed.gif&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:7 --&gt;&lt;br /&gt;
&lt;br /&gt;
Liberty BASIC BmpButtons don&#039;t conform to 32-bit Windows norms in their appearance. Liberty BASIC BmpButtons invert their colors as a signal that they are depressed. (When I&#039;m depressed, I reach for a good book!)&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:8:&amp;lt;img src=&amp;quot;/file/view/invert.gif/30318506/invert.gif&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/invert.gif/30318506/invert.gif&quot; alt=&quot;invert.gif&quot; title=&quot;invert.gif&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:8 --&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Stylebits to the Rescue!&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The STYLEBITS command, which is new in Liberty BASIC 4, allows us to alter the properties of a control or window. The first argument is for adding stylebits. We can alter a regular BUTTON by adding the _BS_BITMAP style to it, like this:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;stylebits #1.b, _BS_BITMAP,0,0,0&amp;lt;br/&amp;gt;button #1.b, &amp;amp;quot;&amp;amp;quot;,[click],UL,10,10,25,25&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;stylebits #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b&lt;/span&gt;, _BS_BITMAP,&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
button #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;,&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;click&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;,UL,&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
The button doesn&#039;t need a caption, since the text won&#039;t be displayed anyway. The width and height arguments should match the width and height of the image we plan to use on our bmpbutton. If we don&#039;t include width and height arguments, Liberty BASIC sizes the button to fit the caption.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Sending a Message&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The regular button has now become a BmpButton. If we stop here, it won&#039;t look very good!&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:9:&amp;lt;img src=&amp;quot;/file/view/blankbutton.gif/30318508/blankbutton.gif&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/blankbutton.gif/30318508/blankbutton.gif&quot; alt=&quot;blankbutton.gif&quot; title=&quot;blankbutton.gif&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:9 --&gt;&lt;br /&gt;
&lt;br /&gt;
We must tell the button which image to display. We do that by using the SendMessageA API call. The function requires the handle to the button. We retrieve that handle with the HWND command:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    hButton=hwnd(#1.b)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    hButton&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;hwnd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;#&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
The next argument is the message to send, which is _BM_SETIMAGE. This is the message that tells the button to use the image whose handle is passed into the function. The next argument tells the function the type of image being used. We are using a bitmap, so this is _IMAGE_BITMAP. The last argument is the handle of the bitmap. We must first load a bmp with LOADBMP, then retrieve its handle with HBMP.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;loadbmp &amp;amp;quot;test&amp;amp;quot;,&amp;amp;quot;bmp\copy.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;hBitmap = hbmp(&amp;amp;quot;test&amp;amp;quot;)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;loadbmp &lt;span class=&quot;st0&quot;&gt;&amp;quot;test&amp;quot;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&amp;quot;bmp\copy.bmp&amp;quot;&lt;/span&gt;
hBitmap &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; hbmp&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;test&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;br /&gt;
Here is the SendMessageA function as it appears in the demo program:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;,_&amp;lt;br/&amp;gt;    hButton As uLong, _      &#039;handle of button&amp;lt;br/&amp;gt;    _BM_SETIMAGE As Long,_   &#039;message to set new image&amp;lt;br/&amp;gt;    _IMAGE_BITMAP as long,_  &#039;type of image&amp;lt;br/&amp;gt;    hBitmap As uLong,_       &#039;handle of bitmap&amp;lt;br/&amp;gt;    re As Long&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;,_
    hButton &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;uLong&lt;/span&gt;, _      &lt;span class=&quot;co1&quot;&gt;&#039;handle of button&lt;/span&gt;
    _BM_SETIMAGE &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;,_   &lt;span class=&quot;co1&quot;&gt;&#039;message to set new image&lt;/span&gt;
    _IMAGE_BITMAP &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;long&lt;/span&gt;,_  &lt;span class=&quot;co1&quot;&gt;&#039;type of image&lt;/span&gt;
    hBitmap &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;uLong&lt;/span&gt;,_       &lt;span class=&quot;co1&quot;&gt;&#039;handle of bitmap&lt;/span&gt;
    re &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;br /&gt;
&lt;hr /&gt;
&lt;strong&gt;DEMO &lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;&#039;run from root LB directory so program can find bmp&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;loadbmp &amp;amp;quot;test&amp;amp;quot;,&amp;amp;quot;bmp\copy.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;hBitmap = hbmp(&amp;amp;quot;test&amp;amp;quot;)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;nomainwin&amp;lt;br/&amp;gt;stylebits #1.b, _BS_BITMAP,0,0,0&amp;lt;br/&amp;gt;button #1.b, &amp;amp;quot;&amp;amp;quot;,[click],UL,10,10,35,35&amp;lt;br/&amp;gt;open &amp;amp;quot;Bmpbutton Play&amp;amp;quot; for window as #1&amp;lt;br/&amp;gt;#1 &amp;amp;quot;trapclose [quit]&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    hButton=hwnd(#1.b)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    &#039;set new bmp&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;,_&amp;lt;br/&amp;gt;    hButton As uLong, _      &#039;handle of button&amp;lt;br/&amp;gt;    _BM_SETIMAGE As Long,_   &#039;message to set new image&amp;lt;br/&amp;gt;    _IMAGE_BITMAP as long,_  &#039;type of image&amp;lt;br/&amp;gt;    hBitmap As uLong,_       &#039;handle of bitmap&amp;lt;br/&amp;gt;    re As Long&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[quit] unloadbmp &amp;amp;quot;test&amp;amp;quot;:close #1:end&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[click]&amp;lt;br/&amp;gt;   &#039;notice &amp;amp;quot;Hello&amp;amp;quot;&amp;lt;br/&amp;gt;    wait&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;run from root LB directory so program can find bmp&lt;/span&gt;
&amp;nbsp;
loadbmp &lt;span class=&quot;st0&quot;&gt;&amp;quot;test&amp;quot;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&amp;quot;bmp\copy.bmp&amp;quot;&lt;/span&gt;
hBitmap &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; hbmp&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;test&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
nomainwin
stylebits #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b&lt;/span&gt;, _BS_BITMAP,&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
button #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;,&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;click&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;,UL,&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;35&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;35&lt;/span&gt;
open &lt;span class=&quot;st0&quot;&gt;&amp;quot;Bmpbutton Play&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; window &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
#&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;trapclose [quit]&amp;quot;&lt;/span&gt;
&amp;nbsp;
    hButton&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;hwnd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;#&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;co1&quot;&gt;&#039;set new bmp&lt;/span&gt;
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;,_
    hButton &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;uLong&lt;/span&gt;, _      &lt;span class=&quot;co1&quot;&gt;&#039;handle of button&lt;/span&gt;
    _BM_SETIMAGE &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;,_   &lt;span class=&quot;co1&quot;&gt;&#039;message to set new image&lt;/span&gt;
    _IMAGE_BITMAP &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;long&lt;/span&gt;,_  &lt;span class=&quot;co1&quot;&gt;&#039;type of image&lt;/span&gt;
    hBitmap &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;uLong&lt;/span&gt;,_       &lt;span class=&quot;co1&quot;&gt;&#039;handle of bitmap&lt;/span&gt;
    re &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;
&amp;nbsp;
wait
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;quit&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; unloadbmp &lt;span class=&quot;st0&quot;&gt;&amp;quot;test&amp;quot;&lt;/span&gt;:close #&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;:&lt;span class=&quot;kw1&quot;&gt;end&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;click&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
   &lt;span class=&quot;co1&quot;&gt;&#039;notice &amp;quot;Hello&amp;quot;&lt;/span&gt;
    wait&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;</description>
          </item>
    <item>
      <title>LayeredWindowTransparency</title>
      <link>https://lbpe.wikispaces.com/LayeredWindowTransparency</link>
      <dc:creator>RodBird</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/LayeredWindowTransparency</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/LayeredWindowTransparency</comments>
      <pubDate>Wed, 25 Nov 2015 17:32:34 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x-Fun With Transparent Windows&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Fun With Transparent Windows&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;strong&gt;#User32 - &amp;quot;SetLayeredWindowAttributes&amp;quot;&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x-Fun With Transparent Windows-Janet Terra with inspiration from Alyce Watson and Stefan Pendl&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;Janet Terra with inspiration from Alyce Watson and Stefan Pendl&lt;/h3&gt;
 &lt;br /&gt;
Windows 2000 and Windows XP both support transparent and semi-transparent windows. If you are designing a program for others, you will want to be sure the host computer supports transparent windows. This function, available at &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.alycesrestaurant.com/osversion.htm/&quot; rel=&quot;nofollow&quot;&gt;Alyce&#039;s Restaurant&lt;/a&gt;, will retrieve the OS version. A returned MajorVer of 5, setting the OSVersionFlag value to 1, indicates the required Windows 2000 or XP.&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    If OSVersionFlag() Then&amp;lt;br/&amp;gt;        Print &amp;amp;quot;This computer DOES support Transparent Windows&amp;amp;quot;&amp;lt;br/&amp;gt;    Else&amp;lt;br/&amp;gt;        Print &amp;amp;quot;This computer DOES NOT support Transparent Windows&amp;amp;quot;&amp;lt;br/&amp;gt;    End If&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Function OSVersionFlag()&amp;lt;br/&amp;gt;    struct OSVERSIONINFO, _&amp;lt;br/&amp;gt;        dwOSVersionInfoSize as Long, _&amp;lt;br/&amp;gt;        dwMajorVersion as Long, _&amp;lt;br/&amp;gt;        dwMinorVersion as Long, _&amp;lt;br/&amp;gt;        dwBuildNumber as Long, _&amp;lt;br/&amp;gt;        dwPlatformId as Long, _&amp;lt;br/&amp;gt;        szCSDVersion as Char[128]&amp;lt;br/&amp;gt;    L = Len(OSVERSIONINFO.struct)&amp;lt;br/&amp;gt;    OSVERSIONINFO.dwOSVersionInfoSize.struct = L&amp;lt;br/&amp;gt;    CallDLL #kernel32, &amp;amp;quot;GetVersionExA&amp;amp;quot;, _&amp;lt;br/&amp;gt;        OSVERSIONINFO as struct, _&amp;lt;br/&amp;gt;        result as long&amp;lt;br/&amp;gt;    MajorVer = OSVERSIONINFO.dwMajorVersion.struct&amp;lt;br/&amp;gt;    If MajorVer &amp;amp;lt; 5 Then&amp;lt;br/&amp;gt;        OSVersionFlag = 0&amp;lt;br/&amp;gt;    Else&amp;lt;br/&amp;gt;        OSVersionFlag = 1&amp;lt;br/&amp;gt;    End If&amp;lt;br/&amp;gt;End Function&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; OSVersionFlag() &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt;
        &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;This computer DOES support Transparent Windows&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;Else&lt;/span&gt;
        &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;This computer DOES NOT support Transparent Windows&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Function&lt;/span&gt; OSVersionFlag()
    struct OSVERSIONINFO, _
        dwOSVersionInfoSize &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        dwMajorVersion &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        dwMinorVersion &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        dwBuildNumber &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        dwPlatformId &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        szCSDVersion &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Char[128]
    L = Len(OSVERSIONINFO.struct)
    OSVERSIONINFO.dwOSVersionInfoSize.struct = L
    CallDLL #kernel32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;GetVersionExA&amp;quot;&lt;/span&gt;, _
        OSVERSIONINFO &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; struct, _
        result &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;
    MajorVer = OSVERSIONINFO.dwMajorVersion.struct
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; MajorVer &amp;lt; 5 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt;
        OSVersionFlag = 0
    &lt;span class=&quot;kw3&quot;&gt;Else&lt;/span&gt;
        OSVersionFlag = 1
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;hr /&gt;
Once the programmer has established the host machine will support a transparent window, the window can be opened. Prior to Liberty BASIC v4.0 and Stylebits, the only way to code a transparent window was after opening the window and then issuing a SetWindowLongA to the User32.dll to give that window a layered quality. After the layered message was sent, a call to SetLayeredWindowAttributes was issued, again to the User32.dll to define the amount of transparency, more correctly called opacity. This is the technique used in John Richardson&#039;s &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://mysite.homeportwest.com/db96.html#ch297&quot; rel=&quot;nofollow&quot;&gt;LB Spier&lt;/a&gt; and discussed in the &lt;a class=&quot;wiki_link&quot; href=&quot;https://basic.wikispaces.com/TransparentWindow&quot;&gt;Transparent Window&lt;/a&gt; article at the &lt;a class=&quot;wiki_link&quot; href=&quot;https://basic.wikispaces.com/home&quot;&gt;Liberty BASIC Programming Wiki&lt;/a&gt; Site.&lt;br /&gt;
&lt;br /&gt;
A more recent, and perhaps more effective, method of coding a transparent window is by including &lt;tt&gt;WS_EX_LAYERED&lt;/tt&gt; in the window&#039;s addExtendedBits, the third parameter of the Stylebits command. As in the previous method, a call is then made to SetLayeredWindowAttributes in the User32.dll to define the amount of opacity.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x-Fun With Transparent Windows-The WS_EX_LAYERED addExtendedBits Stylebit&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;&lt;em&gt;The WS_EX_LAYERED addExtendedBits Stylebit&lt;/em&gt;&lt;/h3&gt;
 &lt;br /&gt;
&lt;tt&gt;WS_EX_LAYERED&lt;/tt&gt; is one of the Windows constants that is not recognized by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasic.com&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC.&lt;/a&gt; This doesn&#039;t mean that the style can&#039;t be used, though. It just means the numerical value of that Windows constant will need to be determined and assigned as either a literal or a variable. &lt;em&gt;See &lt;a class=&quot;wiki_link&quot; href=&quot;/StylebitsWindowsConstants&quot;&gt;Stylebits and Windows Constants&lt;/a&gt; for further discussion if needed.&lt;/em&gt; Here, we&#039;ll assign the correct value of &lt;tt&gt;524288&lt;/tt&gt; to the variable &lt;tt&gt;WS.EX.LAYERED&lt;/tt&gt;.&lt;br /&gt;
&lt;hr /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    WS.EX.LAYERED = 524288&amp;lt;br/&amp;gt;    Stylebits #w, 0, 0, WS.EX.LAYERED, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    WS.EX.LAYERED = 524288
    Stylebits #w, 0, 0, WS.EX.LAYERED, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;hr /&gt;
&lt;br /&gt;
Having given the layered quality to the window, the opacity is then determined after the window is opened. This is done with a call to &amp;quot;SetLayeredWindowAttributes.&amp;quot;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    CallDLL #user32, &amp;amp;quot;SetLayeredWindowAttributes&amp;amp;quot;, _&amp;lt;br/&amp;gt;        hMain as Ulong, _&amp;lt;br/&amp;gt;        ColorRef as Ulong, _&amp;lt;br/&amp;gt;        bAlpha as Short, _&amp;lt;br/&amp;gt;        dwFLAGS as Long, _&amp;lt;br/&amp;gt;        result as long&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SetLayeredWindowAttributes&amp;quot;&lt;/span&gt;, _
        hMain &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Ulong, _
        ColorRef &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Ulong, _
        bAlpha &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Short, _
        dwFLAGS &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        result &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;Looking at the four passed parameters more closely -&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;strong&gt;hMain&lt;/strong&gt; is the handle of the main window. Typically, this is the first parameter to be passed to any DLL when that DLL modifies a window or control.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ColorRef&lt;/strong&gt; is the color assigned to be transparent. ColorRef is only relevant when the fourth parameter, dwFLAGS, is assigned as LWA_COLORKEY.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;bAlpha&lt;/strong&gt; is the amount of transparency or opacity. bAlpha is sometimes referred to as BlendedAlpha. When bAlpha is set at 0, the window is completely transparent. When bAlpha is set at 255, the window is completely opaque, the normal or default state. bAlpha is only relevant when the fourth parameter, dwFLAGS, is assigned as LWA_ALPHA.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;dwFLAGS&lt;/strong&gt; is the desired event to be passed to the DLL. There are actually two layered window actions that can be passed in the &amp;quot;SetLayeredWindowAttributes&amp;quot; call. The first is LWA_COLORKEY and the second is LWA_ALPHA.&lt;br /&gt;
LWA_COLORKEY assigns one color of the window to be transparent. If the value of dwFLAGS is set to LWA_COLORKEY, then that one assigned color is the color passed in ColorRef and bAlpha is ignored. If the value of dwFLAGS is set to LWA_ALPHA, then the degree of opacity of the entire window is set to the value passed in bAlpha and ColorRef is ignored.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x-Fun With Transparent Windows-Demo of LWA_ALPHA&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;&lt;em&gt;Demo of LWA_ALPHA&lt;/em&gt;&lt;/h3&gt;
 &lt;br /&gt;
The &lt;a class=&quot;wiki_link&quot; href=&quot;https://basic.wikispaces.com/TransparentWindow&quot;&gt;Transparent Window&lt;/a&gt; demo works with the action &lt;tt&gt;LWA_ALPHA&lt;/tt&gt;. The numerical value of the Windows constant &lt;tt&gt;LWA_ALPHA&lt;/tt&gt; is &lt;tt&gt;2&lt;/tt&gt;. Since &lt;tt&gt;LWA_ALPHA&lt;/tt&gt; is not a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasic.com&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC&lt;/a&gt; recognized constant, then that value (&lt;tt&gt;2&lt;/tt&gt;) will be assigned to the user defined variable &lt;tt&gt;LWA.ALPHA&lt;/tt&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    LWA.ALPHA = 2&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    LWA.ALPHA = 2&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;Here is a simple modification of &lt;a class=&quot;wiki_link&quot; href=&quot;https://basic.wikispaces.com/TransparentWindow&quot;&gt;Transparent Window&lt;/a&gt; using the previously described constants and variables. &lt;em&gt;&lt;strong&gt;This demo requires Windows 2000, Windows XP, or better.&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;&#039; Set the Variables&amp;lt;br/&amp;gt;    WS.EX.LAYERED = 524288 &#039; WS_EX_LAYERED Unrecognized Windows constant&amp;lt;br/&amp;gt;    ColorRef = 0 &#039; ColorRef ignored in this demo so value is irrelevant&amp;lt;br/&amp;gt;    bAlpha = 128 &#039; Degree of opacity (0 - 255)&amp;lt;br/&amp;gt;    LWA.ALPHA = 2 &#039; LWA_ALPHA Unrecognized Windows constant&amp;lt;br/&amp;gt;    dwFLAGS = LWA.ALPHA &#039; Action is transparency of entire window (LWA_ALPHA)&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    WindowWidth = 600&amp;lt;br/&amp;gt;    WindowHeight = 400&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = int((DisplayWidth-WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = int((DisplayHeight-WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    text$ = &amp;amp;quot;Translucence here is initially set at 128.  Try &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;setting bAlpha to higher and lower numbers for desired &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;transparency.  0 will make your window complete &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;transparent.  255 is the maximum.  This demo will &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;NOT work on Windows 98 or Windows 95.&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #main.msg, text$, 20, 20, 550, 200&amp;lt;br/&amp;gt;    Stylebits #main, 0, 0, WS.EX.LAYERED, 0&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Transparent Window&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    hMain = hWnd(#main)&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Verdana 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    Call SetLayeredWindowAttributes, hMain, ColorRef, bAlpha, dwFLAGS&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub EndDemo handle$&amp;lt;br/&amp;gt;    Close #main&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub SetLayeredWindowAttributes hWindow, ColorRef, bAlpha, dwFLAGS&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;SetLayeredWindowAttributes&amp;amp;quot;, _&amp;lt;br/&amp;gt;        hWindow as Ulong, _&amp;lt;br/&amp;gt;        ColorRef as Long, _&amp;lt;br/&amp;gt;        bAlpha as Long, _&amp;lt;br/&amp;gt;        dwFLAGS as Long, _&amp;lt;br/&amp;gt;        result as Long&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Set the Variables
&lt;/span&gt;    WS.EX.LAYERED = 524288 &lt;span class=&quot;co1&quot;&gt;&#039; WS_EX_LAYERED Unrecognized Windows constant
&lt;/span&gt;    ColorRef = 0 &lt;span class=&quot;co1&quot;&gt;&#039; ColorRef ignored in this demo so value is irrelevant
&lt;/span&gt;    bAlpha = 128 &lt;span class=&quot;co1&quot;&gt;&#039; Degree of opacity (0 - 255)
&lt;/span&gt;    LWA.ALPHA = 2 &lt;span class=&quot;co1&quot;&gt;&#039; LWA_ALPHA Unrecognized Windows constant
&lt;/span&gt;    dwFLAGS = LWA.ALPHA &lt;span class=&quot;co1&quot;&gt;&#039; Action is transparency of entire window (LWA_ALPHA)
&lt;/span&gt;    Nomainwin
&amp;nbsp;
    WindowWidth = 600
    WindowHeight = 400
&amp;nbsp;
    UpperLeftX = int((DisplayWidth-WindowWidth)/2)
    UpperLeftY = int((DisplayHeight-WindowHeight)/2)
&amp;nbsp;
    text$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Translucence here is initially set at 128.  Try &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;setting bAlpha to higher and lower numbers for desired &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;transparency.  0 will make your window complete &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;transparent.  255 is the maximum.  This demo will &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;NOT work on Windows 98 or Windows 95.&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Statictext #main.msg, text$, 20, 20, 550, 200
    Stylebits #main, 0, 0, WS.EX.LAYERED, 0
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Transparent Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
&amp;nbsp;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    hMain = hWnd(#main)
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Verdana 12 Bold&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;Call&lt;/span&gt; SetLayeredWindowAttributes, hMain, ColorRef, bAlpha, dwFLAGS
&amp;nbsp;
    Wait
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; SetLayeredWindowAttributes hWindow, ColorRef, bAlpha, dwFLAGS
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SetLayeredWindowAttributes&amp;quot;&lt;/span&gt;, _
        hWindow &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Ulong, _
        ColorRef &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        bAlpha &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        dwFLAGS &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        result &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;hr /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;x-Fun With Transparent Windows-Stefan Pendl&#039;s Demo Using LWA_COLORKEY&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;&lt;em&gt;Stefan Pendl&#039;s Demo Using LWA_COLORKEY&lt;/em&gt;&lt;/h3&gt;
 &lt;br /&gt;
The inspiration for this article came from Stefan Pendl&lt;!-- ws:start:WikiTextUserlinkRule:09:[[user:StPendl]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/StPendl&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/StPendl-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StPendl&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/StPendl&quot; style=&quot;outline: none;&quot;&gt;StPendl&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:09 --&gt;, one of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasic.com&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC&#039;s&lt;/a&gt; true gurus. Stefan is a contributor at both the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.yahoo.com/group/libertybasic/&quot; rel=&quot;nofollow&quot;&gt;Official Liberty BASIC Support Group&lt;/a&gt; and the very popular &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://libertybasic.conforums.com/&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC Conforum.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;The Request&lt;/strong&gt;: &lt;em&gt;&amp;quot;I have read in the news letter 132 about how to make shaped windows, but it is a little bit confusing, is there a way faster then reading pixle by pixle, like setting one color as the part to be deleted, and if thats what the other examples do, can i make the drawing without haveing to use api calls for&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;drawing. my whole goal in total is to make an icon sized animal walk around on the screen. I have a program that does it already, but i would like to make my&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;own thing. Thanks in advance.&amp;quot;&lt;/em&gt; &lt;tt&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.yahoo.com/group/libertybasic/message/31512&quot; rel=&quot;nofollow&quot;&gt;Message #31512&lt;/a&gt;&lt;/tt&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Stefan&#039;s Reply&lt;/strong&gt;: &lt;em&gt;&amp;quot;How about making a fullscreen graphic window, make it transparent and use simple sprites ???&amp;quot;&lt;/em&gt;&lt;tt&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.yahoo.com/group/libertybasic/message/31533&quot; rel=&quot;nofollow&quot;&gt;Message #31533&lt;/a&gt;&lt;/tt&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:25:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@StefansDemo&amp;quot; title=&amp;quot;Anchor: StefansDemo&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;StefansDemo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:25 --&gt;&lt;br /&gt;
&lt;strong&gt;Stefan&#039;s Demo&lt;/strong&gt; &lt;tt&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.yahoo.com/group/libertybasic/message/31576&quot; rel=&quot;nofollow&quot;&gt;Message #31576&lt;/a&gt;&lt;/tt&gt; &lt;em&gt;Be sure to run this demo from your&lt;/em&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasic.com/&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC&lt;/a&gt; &lt;em&gt;root directory so the&lt;/em&gt; &lt;strong&gt;/SPRITES&lt;/strong&gt; folder &lt;em&gt;and&lt;/em&gt; &lt;strong&gt;cave1.bmp&lt;/strong&gt; &lt;em&gt;can be found.&lt;/em&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;&#039;&amp;amp;#45;&amp;amp;#45;-code start&amp;lt;br/&amp;gt;nomainwin&amp;lt;br/&amp;gt;WindowWidth = DisplayWidth&amp;lt;br/&amp;gt;WindowHeight = DisplayHeight&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; You may want to change this path to your own path&amp;lt;br/&amp;gt;LBFolder$ = &amp;amp;quot;C:\Programme\Liberty BASIC v4.03&amp;amp;quot;&amp;lt;br/&amp;gt;&#039; or simply&amp;lt;br/&amp;gt;&#039; LBFolder$ = DefaultDir$&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;graphicbox #m.g, 0, 0, WindowWidth, WindowHeight&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;set the window to layered and topmost, to keep sprite visible&amp;lt;br/&amp;gt;&#039;and have access to the windows beneeth&amp;lt;br/&amp;gt;WS.EX.LAYERED = hexdec(&amp;amp;quot;80000&amp;amp;quot;)&amp;lt;br/&amp;gt;stylebits #m, 0, 0, WS.EX.LAYERED or _WS_EX_TOPMOST, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;open &amp;amp;quot;Sprite on Transparent Background&amp;amp;quot; for window_popup as #m&amp;lt;br/&amp;gt;#m &amp;amp;quot;trapclose quit&amp;amp;quot;&amp;lt;br/&amp;gt;#m.g &amp;amp;quot;down&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;make the white portion of the window transparent&amp;lt;br/&amp;gt;hwndMain = hwnd(#m)&amp;lt;br/&amp;gt;LWA.COLORKEY = 1&amp;lt;br/&amp;gt;COLORREF = hexdec(&amp;amp;quot;FFFFFF&amp;amp;quot;)&amp;lt;br/&amp;gt;calldll #user32, &amp;amp;quot;SetLayeredWindowAttributes&amp;amp;quot;, _&amp;lt;br/&amp;gt;hwndMain as ulong, _&amp;lt;br/&amp;gt;COLORREF as ulong, _&amp;lt;br/&amp;gt;bAlpha as short, _&amp;lt;br/&amp;gt;LWA.COLORKEY as long, _&amp;lt;br/&amp;gt;result as long&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;loadbmp &amp;amp;quot;man&amp;amp;quot;, LBFolder$ + &amp;amp;quot;\sprites\cave1.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;loadbmp &amp;amp;quot;man1&amp;amp;quot;, LBFolder$ + &amp;amp;quot;\sprites\cave2.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;#m.g &amp;amp;quot;addsprite test man man1&amp;amp;quot;&amp;lt;br/&amp;gt;#m.g &amp;amp;quot;home;posxy xPos yPos&amp;amp;quot;&amp;lt;br/&amp;gt;#m.g &amp;amp;quot;spritexy test &amp;amp;quot;; xPos; &amp;amp;quot; &amp;amp;quot;; yPos&amp;lt;br/&amp;gt;#m.g &amp;amp;quot;cyclesprite test 1&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;call moveSprite &amp;amp;quot;&amp;amp;quot;, &amp;amp;quot;&amp;amp;quot;, xPos, yPos&amp;lt;br/&amp;gt;timer 100, drawFrame&amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;sub quit handle$&amp;lt;br/&amp;gt;unloadbmp &amp;amp;quot;man&amp;amp;quot;&amp;lt;br/&amp;gt;close #handle$&amp;lt;br/&amp;gt;end&amp;lt;br/&amp;gt;end sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;sub moveSprite handle$, sprite$, xPosOld, yPosOld&amp;lt;br/&amp;gt;xPos = int(rnd(0) * DisplayWidth) + 1&amp;lt;br/&amp;gt;yPos = int(rnd(0) * DisplayHeight) + 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;if xPosOld &amp;amp;lt; xPos then&amp;lt;br/&amp;gt;#m.g &amp;amp;quot;spriteorient test normal&amp;amp;quot;&amp;lt;br/&amp;gt;else&amp;lt;br/&amp;gt;#m.g &amp;amp;quot;spriteorient test mirror&amp;amp;quot;&amp;lt;br/&amp;gt;end if&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;#m.g &amp;amp;quot;spritetravelxy test &amp;amp;quot;; xPos; &amp;amp;quot; &amp;amp;quot;; yPos; &amp;amp;quot; 15 moveSprite&amp;amp;quot;&amp;lt;br/&amp;gt;end sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;sub drawFrame&amp;lt;br/&amp;gt;#m.g &amp;amp;quot;drawsprites&amp;amp;quot;&amp;lt;br/&amp;gt;wait &#039; †Added to original code by Janet, see footnote for discussion&amp;lt;br/&amp;gt;end sub&amp;lt;br/&amp;gt;&#039;&amp;amp;#45;&amp;amp;#45;-code end&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039;---code start
&lt;/span&gt;nomainwin
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; You may want to change this path to your own path
&lt;/span&gt;LBFolder$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;C:\Programme\Liberty BASIC v4.03&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; or simply
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039; LBFolder$ = DefaultDir$
&lt;/span&gt;
graphicbox #m.g, 0, 0, WindowWidth, WindowHeight
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;set the window to layered and topmost, to keep sprite visible
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;and have access to the windows beneeth
&lt;/span&gt;WS.EX.LAYERED = hexdec(&lt;span class=&quot;st0&quot;&gt;&amp;quot;80000&amp;quot;&lt;/span&gt;)
stylebits #m, 0, 0, WS.EX.LAYERED &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _WS_EX_TOPMOST, 0
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Sprite on Transparent Background&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; window_popup &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #m
#m &lt;span class=&quot;st0&quot;&gt;&amp;quot;trapclose quit&amp;quot;&lt;/span&gt;
#m.g &lt;span class=&quot;st0&quot;&gt;&amp;quot;down&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;make the white portion of the window transparent
&lt;/span&gt;hwndMain = hwnd(#m)
LWA.COLORKEY = 1
COLORREF = hexdec(&lt;span class=&quot;st0&quot;&gt;&amp;quot;FFFFFF&amp;quot;&lt;/span&gt;)
calldll #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SetLayeredWindowAttributes&amp;quot;&lt;/span&gt;, _
hwndMain &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; ulong, _
COLORREF &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; ulong, _
bAlpha &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; short, _
LWA.COLORKEY &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;, _
result &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;
&amp;nbsp;
loadbmp &lt;span class=&quot;st0&quot;&gt;&amp;quot;man&amp;quot;&lt;/span&gt;, LBFolder$ + &lt;span class=&quot;st0&quot;&gt;&amp;quot;\sprites\cave1.bmp&amp;quot;&lt;/span&gt;
loadbmp &lt;span class=&quot;st0&quot;&gt;&amp;quot;man1&amp;quot;&lt;/span&gt;, LBFolder$ + &lt;span class=&quot;st0&quot;&gt;&amp;quot;\sprites\cave2.bmp&amp;quot;&lt;/span&gt;
#m.g &lt;span class=&quot;st0&quot;&gt;&amp;quot;addsprite test man man1&amp;quot;&lt;/span&gt;
#m.g &lt;span class=&quot;st0&quot;&gt;&amp;quot;home;posxy xPos yPos&amp;quot;&lt;/span&gt;
#m.g &lt;span class=&quot;st0&quot;&gt;&amp;quot;spritexy test &amp;quot;&lt;/span&gt;; xPos; &lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;; yPos
#m.g &lt;span class=&quot;st0&quot;&gt;&amp;quot;cyclesprite test 1&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;call&lt;/span&gt; moveSprite &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, xPos, yPos
timer 100, drawFrame
wait
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;sub&lt;/span&gt; quit handle$
unloadbmp &lt;span class=&quot;st0&quot;&gt;&amp;quot;man&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;close&lt;/span&gt; #handle$
&lt;span class=&quot;kw3&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;sub&lt;/span&gt; moveSprite handle$, sprite$, xPosOld, yPosOld
xPos = int(rnd(0) * DisplayWidth) + 1
yPos = int(rnd(0) * DisplayHeight) + 1
&amp;nbsp;
&lt;span class=&quot;kw3&quot;&gt;if&lt;/span&gt; xPosOld &amp;lt; xPos &lt;span class=&quot;kw3&quot;&gt;then&lt;/span&gt;
#m.g &lt;span class=&quot;st0&quot;&gt;&amp;quot;spriteorient test normal&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;else&lt;/span&gt;
#m.g &lt;span class=&quot;st0&quot;&gt;&amp;quot;spriteorient test mirror&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;if&lt;/span&gt;
&amp;nbsp;
#m.g &lt;span class=&quot;st0&quot;&gt;&amp;quot;spritetravelxy test &amp;quot;&lt;/span&gt;; xPos; &lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;; yPos; &lt;span class=&quot;st0&quot;&gt;&amp;quot; 15 moveSprite&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;sub&lt;/span&gt; drawFrame
#m.g &lt;span class=&quot;st0&quot;&gt;&amp;quot;drawsprites&amp;quot;&lt;/span&gt;
wait &lt;span class=&quot;co1&quot;&gt;&#039; †Added to original code by Janet, see footnote for discussion
&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;sub&lt;/span&gt;
&#039;---code &lt;span class=&quot;kw3&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;† &lt;em&gt;A recently identified &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://libertybasic.conforums.com/index.cgi?board=bugs&amp;amp;action=display&amp;amp;num=1153914041&quot; rel=&quot;nofollow&quot;&gt;bug in with a Timer Sub Event&lt;/a&gt; using &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasic.com&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC&lt;/a&gt; is easily fixed by adding a WAIT statement in that fired sub event.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;How cool is this!!&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;x-Fun With Transparent Windows-Closing Stefan&#039;s Demo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;&lt;em&gt;Closing Stefan&#039;s Demo&lt;/em&gt;&lt;/h3&gt;
 &lt;br /&gt;
It may be difficult to regain focus of a transparent window. If you are finding difficulty closing Stefan&#039;s demo, press &lt;strong&gt;Alt - Tab&lt;/strong&gt; until &lt;tt&gt;Sprite on Transparent Background&lt;/tt&gt; is selected. Then press &lt;strong&gt;Alt - F4&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;x-Fun With Transparent Windows-How Does Stefan&#039;s Demo Work?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;&lt;em&gt;How Does Stefan&#039;s Demo Work?&lt;/em&gt;&lt;/h3&gt;
 &lt;br /&gt;
In &lt;a class=&quot;wiki_link&quot; href=&quot;/LayeredWindowTransparency#StefansDemo&quot;&gt;Stefan&#039;s Demo&lt;/a&gt;, a popup window is used. The background is white. White (&amp;amp;FFFFFF or 16777215) is set as the transparent color and no white pixels are drawn. Since the entire window is white, effectively, no pixel of the window is drawn. The window still provides a background for the sprite, though, and the sprite is content to bounce around that invisible window.&lt;br /&gt;
&lt;br /&gt;
If you change&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;open &amp;amp;quot;Sprite on Transparent Background&amp;amp;quot; for window_popup as #m&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Sprite on Transparent Background&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; window_popup &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #m&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;to&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;open &amp;amp;quot;Sprite on Transparent Background&amp;amp;quot; for window as #m&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Sprite on Transparent Background&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #m&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;you&#039;ll see more clearly how only the white pixels (and the graphicbox is comprised of all white pixels) are not drawn. All non-white pixels, in this case, the window caption and borders are drawn as usual. Notice the distortion of the title bar as the white pixels of the title have not been drawn.&lt;br /&gt;
&lt;br /&gt;
In Stefan&#039;s demo, the Stylebits &lt;tt&gt;_WS_EX_TOPMOST&lt;/tt&gt; is used to keep the invisible window on top of all other windows, even if that window isn&#039;t the window with focus. This is essential to keeping the sprite visible to the viewer. Since the invisible window spans the entire display screen and remains topmost, how then is the user able to interact with other programs? Simply stated, the &lt;strong&gt;&lt;em&gt;&amp;quot;SetLayeredWindowsAttributes&amp;quot;&lt;/em&gt;&lt;/strong&gt; allows all mouseclicks to filter down through the invisible pixels to the window underneath.&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:23:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc7&quot;&gt;&lt;a name=&quot;x-Fun With Transparent Windows-Reversing Transparency&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:23 --&gt;&lt;em&gt;Reversing Transparency&lt;/em&gt;&lt;/h3&gt;
 &lt;br /&gt;
There may be times when you will want to restore the translucent window to the default opacity of &lt;tt&gt;255&lt;/tt&gt; or undo the single color transparency. To restore opacity, simply issue another call to &lt;strong&gt;&lt;em&gt;&amp;quot;SetLayeredWindowAttributes&amp;quot;&lt;/em&gt;&lt;/strong&gt; passing the parameters &lt;tt&gt;bAlpha&lt;/tt&gt; with the value of &lt;tt&gt;255&lt;/tt&gt; and &lt;tt&gt;dwFLAGS&lt;/tt&gt; with the value of &lt;tt&gt;LWA_ALPHA&lt;/tt&gt;, or &lt;tt&gt;2&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
When the passed &lt;tt&gt;dwFLAGS&lt;/tt&gt; parameter is &lt;tt&gt;LWA_COLORKEY&lt;/tt&gt;, the transparent color can be made opaque by assigning &lt;tt&gt;ColorKey&lt;/tt&gt; a value of a non present color or even by passing &lt;tt&gt;bAlpha&lt;/tt&gt; with a value of &lt;tt&gt;255&lt;/tt&gt; and &lt;tt&gt;dwFLAGS&lt;/tt&gt; with the value of &lt;tt&gt;LWA.COLORKEY&lt;/tt&gt; or &lt;tt&gt;2&lt;/tt&gt;. Either might be effective in many cases, but the best method is to simply remove the Layered attribute. Get the current value of the &lt;tt&gt;extendedAddBits&lt;/tt&gt; of the window with &lt;strong&gt;&lt;em&gt;&amp;quot;GetWindowLongA&amp;quot;&lt;/em&gt;&lt;/strong&gt;. To this result, &lt;em&gt;subtract&lt;/em&gt; the value of &lt;tt&gt;WS.EX.LAYERED&lt;/tt&gt; using the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://babek.info/libertybasicfiles/lbnews/nl111/api.htm&quot; rel=&quot;nofollow&quot;&gt;Bitwise Operand&lt;/a&gt; &lt;tt&gt;XOR&lt;/tt&gt;. Write the new value back to the window by calling &lt;strong&gt;&lt;em&gt;&amp;quot;SetWindowLongA&amp;quot;&lt;/em&gt;&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;&#039; Demo to demonstrating defining and reversing transparency&amp;lt;br/&amp;gt;&#039; Set the Variables&amp;lt;br/&amp;gt;    WS.EX.LAYERED = 524288 &#039; WS_EX_LAYERED Unrecognized Windows constant&amp;lt;br/&amp;gt;    ColorRef = 255 &#039; Long Pixel Color, ColorRef is only relevant when dwFLAGS = LWA.COLORKEY&amp;lt;br/&amp;gt;    bAlpha = 128 &#039; Degree of opacity (0 - 255), bAlpha is only relevant when dwFLAGS = LWA.ALPHA&amp;lt;br/&amp;gt;    LWA.COLORKEY = 1 &#039; LWA_COLORKEY Unrecognized Windows constant&amp;lt;br/&amp;gt;    LWA.ALPHA = 2 &#039; LWA_ALPHA Unrecognized Windows constant&amp;lt;br/&amp;gt;&#039; Choose just ONE of these next two lines&amp;lt;br/&amp;gt;    dwFLAGS = LWA.COLORKEY &#039; Action is transparency of just one color (LWA_COLORKEY)&amp;lt;br/&amp;gt;&#039;    dwFLAGS = LWA.ALPHA &#039; Action is transparency of entire window (LWA_ALPHA)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Specify variables holding Windows constants as Global&amp;lt;br/&amp;gt;    Global WS.EX.LAYERED, LWA.COLORKEY, LWA.ALPHA&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    WindowWidth = 600&amp;lt;br/&amp;gt;    WindowHeight = 400&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    BackgroundColor$ = &amp;amp;quot;Red&amp;amp;quot;&amp;lt;br/&amp;gt;    ForegroundColor$ = &amp;amp;quot;Blue&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = int((DisplayWidth-WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = int((DisplayHeight-WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    text1$ = &amp;amp;quot;The red pixels have been rendered transparent &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;in this demo.  This demo will NOT work on Windows &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;98 or Windows 95.&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    text2$ = &amp;amp;quot;Translucence here is initially set at 128.  Try &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;setting bAlpha to higher and lower numbers for desired &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;transparency.  0 will make your window complete &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;transparent.  255 is the maximum.  This demo will &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;NOT work on Windows 98 or Windows 95.&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    If dwFLAGS = 1 Then&amp;lt;br/&amp;gt;        Button #main.btn, &amp;amp;quot; Show All Pixels &amp;amp;quot;, ShowAllPixels, UL, 150, 250, 200, 30&amp;lt;br/&amp;gt;    Else&amp;lt;br/&amp;gt;        Button #main.btn, &amp;amp;quot; FullOpacity &amp;amp;quot;, FullOpacity, UL, 150, 250, 200, 30&amp;lt;br/&amp;gt;    End If&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #main.msg, &amp;amp;quot;&amp;amp;quot;, 20, 20, 550, 200&amp;lt;br/&amp;gt;    Stylebits #main, 0, 0, WS.EX.LAYERED, 0&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Transparent Window&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    hMain = hWnd(#main)&amp;lt;br/&amp;gt;    #main, &amp;amp;quot;Font Verdana 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    If dwFLAGS = 1 Then&amp;lt;br/&amp;gt;        #main.msg text1$&amp;lt;br/&amp;gt;    Else&amp;lt;br/&amp;gt;        #main.msg text2$&amp;lt;br/&amp;gt;    End If&amp;lt;br/&amp;gt;    Call SetLayeredWindowAttributes, hMain, ColorRef, bAlpha, dwFLAGS&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub EndDemo handle$&amp;lt;br/&amp;gt;    Close #main&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub SetLayeredWindowAttributes hWindow, ColorRef, bAlpha, dwFLAGS&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;SetLayeredWindowAttributes&amp;amp;quot;, _&amp;lt;br/&amp;gt;        hWindow as Ulong, _&amp;lt;br/&amp;gt;        ColorRef as Long, _&amp;lt;br/&amp;gt;        bAlpha as Long, _&amp;lt;br/&amp;gt;        dwFLAGS as Long, _&amp;lt;br/&amp;gt;        result as Long&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub FullOpacity handle$&amp;lt;br/&amp;gt;    Call SetLayeredWindowAttributes hWnd(#main), 0, 255, 2&amp;lt;br/&amp;gt;    #main.msg, &amp;amp;quot;The window is now 100% opaque.&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.btn, &amp;amp;quot;!Hide&amp;amp;quot;&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub ShowAllPixels handle$&amp;lt;br/&amp;gt;    hMain = hWnd(#main)&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;GetWindowLongA&amp;amp;quot;, _&amp;lt;br/&amp;gt;        hMain as Ulong, _&amp;lt;br/&amp;gt;        _GWL_EXSTYLE as Long, _&amp;lt;br/&amp;gt;        style as Long&amp;lt;br/&amp;gt;&#039; Remove the extendedAddBits WS.EX.LAYERED&amp;lt;br/&amp;gt;        newStyle = style xor WS.EX.LAYERED&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;SetWindowLongA&amp;amp;quot;, _&amp;lt;br/&amp;gt;        hMain as Ulong, _&amp;lt;br/&amp;gt;        _GWL_EXSTYLE as Long, _&amp;lt;br/&amp;gt;        newStyle as Long, _&amp;lt;br/&amp;gt;        result as Long&amp;lt;br/&amp;gt;    #main.msg, &amp;amp;quot;The red pixels have been repainted.&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.btn, &amp;amp;quot;!Hide&amp;amp;quot;&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Demo to demonstrating defining and reversing transparency
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Set the Variables
&lt;/span&gt;    WS.EX.LAYERED = 524288 &lt;span class=&quot;co1&quot;&gt;&#039; WS_EX_LAYERED Unrecognized Windows constant
&lt;/span&gt;    ColorRef = 255 &lt;span class=&quot;co1&quot;&gt;&#039; Long Pixel Color, ColorRef is only relevant when dwFLAGS = LWA.COLORKEY
&lt;/span&gt;    bAlpha = 128 &lt;span class=&quot;co1&quot;&gt;&#039; Degree of opacity (0 - 255), bAlpha is only relevant when dwFLAGS = LWA.ALPHA
&lt;/span&gt;    LWA.COLORKEY = 1 &lt;span class=&quot;co1&quot;&gt;&#039; LWA_COLORKEY Unrecognized Windows constant
&lt;/span&gt;    LWA.ALPHA = 2 &lt;span class=&quot;co1&quot;&gt;&#039; LWA_ALPHA Unrecognized Windows constant
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Choose just ONE of these next two lines
&lt;/span&gt;    dwFLAGS = LWA.COLORKEY &lt;span class=&quot;co1&quot;&gt;&#039; Action is transparency of just one color (LWA_COLORKEY)
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;    dwFLAGS = LWA.ALPHA &#039; Action is transparency of entire window (LWA_ALPHA)
&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; Specify variables holding Windows constants as Global
&lt;/span&gt;    Global WS.EX.LAYERED, LWA.COLORKEY, LWA.ALPHA
&amp;nbsp;
    Nomainwin
&amp;nbsp;
    WindowWidth = 600
    WindowHeight = 400
&amp;nbsp;
    BackgroundColor$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Red&amp;quot;&lt;/span&gt;
    ForegroundColor$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Blue&amp;quot;&lt;/span&gt;
&amp;nbsp;
    UpperLeftX = int((DisplayWidth-WindowWidth)/2)
    UpperLeftY = int((DisplayHeight-WindowHeight)/2)
&amp;nbsp;
    text1$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;The red pixels have been rendered transparent &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;in this demo.  This demo will NOT work on Windows &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;98 or Windows 95.&amp;quot;&lt;/span&gt;
&amp;nbsp;
    text2$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Translucence here is initially set at 128.  Try &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;setting bAlpha to higher and lower numbers for desired &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;transparency.  0 will make your window complete &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;transparent.  255 is the maximum.  This demo will &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;NOT work on Windows 98 or Windows 95.&amp;quot;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; dwFLAGS = 1 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt;
        Button #main.btn, &lt;span class=&quot;st0&quot;&gt;&amp;quot; Show All Pixels &amp;quot;&lt;/span&gt;, ShowAllPixels, UL, 150, 250, 200, 30
    &lt;span class=&quot;kw3&quot;&gt;Else&lt;/span&gt;
        Button #main.btn, &lt;span class=&quot;st0&quot;&gt;&amp;quot; FullOpacity &amp;quot;&lt;/span&gt;, FullOpacity, UL, 150, 250, 200, 30
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt;
&amp;nbsp;
    Statictext #main.msg, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, 20, 20, 550, 200
    Stylebits #main, 0, 0, WS.EX.LAYERED, 0
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Transparent Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
&amp;nbsp;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    hMain = hWnd(#main)
    #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Verdana 12 Bold&amp;quot;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; dwFLAGS = 1 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt;
        #main.msg text1$
    &lt;span class=&quot;kw3&quot;&gt;Else&lt;/span&gt;
        #main.msg text2$
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;Call&lt;/span&gt; SetLayeredWindowAttributes, hMain, ColorRef, bAlpha, dwFLAGS
&amp;nbsp;
    Wait
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; SetLayeredWindowAttributes hWindow, ColorRef, bAlpha, dwFLAGS
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SetLayeredWindowAttributes&amp;quot;&lt;/span&gt;, _
        hWindow &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Ulong, _
        ColorRef &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        bAlpha &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        dwFLAGS &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        result &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; FullOpacity handle$
    &lt;span class=&quot;kw2&quot;&gt;Call&lt;/span&gt; SetLayeredWindowAttributes hWnd(#main), 0, 255, 2
    #main.msg, &lt;span class=&quot;st0&quot;&gt;&amp;quot;The window is now 100% opaque.&amp;quot;&lt;/span&gt;
    #main.btn, &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Hide&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; ShowAllPixels handle$
    hMain = hWnd(#main)
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;GetWindowLongA&amp;quot;&lt;/span&gt;, _
        hMain &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Ulong, _
        _GWL_EXSTYLE &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        style &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; Remove the extendedAddBits WS.EX.LAYERED
&lt;/span&gt;        newStyle = style &lt;span class=&quot;kw3&quot;&gt;xor&lt;/span&gt; WS.EX.LAYERED
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SetWindowLongA&amp;quot;&lt;/span&gt;, _
        hMain &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Ulong, _
        _GWL_EXSTYLE &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        newStyle &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        result &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;
    #main.msg, &lt;span class=&quot;st0&quot;&gt;&amp;quot;The red pixels have been repainted.&amp;quot;&lt;/span&gt;
    #main.btn, &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Hide&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;hr /&gt;
A special &lt;em&gt;&lt;strong&gt;Thank You&lt;/strong&gt;&lt;/em&gt; to Alyce Watson &lt;!-- ws:start:WikiTextUserlinkRule:010:[[user:alyce]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/alyce&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/alyce-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;alyce&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/alyce&quot; style=&quot;outline: none;&quot;&gt;alyce&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:010 --&gt; and Stefan Pendl &lt;!-- ws:start:WikiTextUserlinkRule:011:[[user:StPendl]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/StPendl&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/StPendl-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;StPendl&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/StPendl&quot; style=&quot;outline: none;&quot;&gt;StPendl&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:011 --&gt; for their continued and unfailing willingness to mentor and share expertise. &lt;!-- ws:start:WikiTextUserlinkRule:012:[[user:JanetTerra]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/JanetTerra-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;JanetTerra&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/JanetTerra&quot; style=&quot;outline: none;&quot;&gt;JanetTerra&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:012 --&gt;&lt;br /&gt;
&lt;hr /&gt;
</description>
          </item>
    <item>
      <title>MDIScroll</title>
      <link>https://lbpe.wikispaces.com/MDIScroll</link>
      <dc:creator>RodBird</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/MDIScroll</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/MDIScroll</comments>
      <pubDate>Mon, 23 Nov 2015 11:42:51 GMT</pubDate>
      <description>&lt;strong&gt;MDI Client to Scroll Controls&lt;/strong&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextTocRule:13:&amp;lt;img id=&amp;quot;wikitext@@toc@@flat&amp;quot; class=&amp;quot;WikiMedia WikiMediaTocFlat&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/flat?w=100&amp;amp;h=16&amp;quot;/&amp;gt; --&gt;&lt;!-- ws:end:WikiTextTocRule:13 --&gt;&lt;!-- ws:start:WikiTextTocRule:14: --&gt;&lt;a href=&quot;#Why Scroll?&quot;&gt;Why Scroll?&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:14 --&gt;&lt;!-- ws:start:WikiTextTocRule:15: --&gt; | &lt;a href=&quot;#MDI is the Key&quot;&gt;MDI is the Key&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:15 --&gt;&lt;!-- ws:start:WikiTextTocRule:16: --&gt; | &lt;a href=&quot;#Creating an MDI Client&quot;&gt;Creating an MDI Client&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:16 --&gt;&lt;!-- ws:start:WikiTextTocRule:17: --&gt; | &lt;a href=&quot;#Creating a Child Window&quot;&gt;Creating a Child Window&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:17 --&gt;&lt;!-- ws:start:WikiTextTocRule:18: --&gt; | &lt;a href=&quot;#Making it Work&quot;&gt;Making it Work&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:18 --&gt;&lt;!-- ws:start:WikiTextTocRule:19: --&gt; | &lt;a href=&quot;#Scrolling Demo&quot;&gt;Scrolling Demo&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:19 --&gt;&lt;!-- ws:start:WikiTextTocRule:20: --&gt;
&lt;!-- ws:end:WikiTextTocRule:20 --&gt;&lt;br /&gt;
For an eBook or printed book on using the API with Liberty BASIC, see:&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://alycesrestaurant.com/apilb/index.htm&quot; rel=&quot;nofollow&quot;&gt;APIs for Liberty BASIC&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:1:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Why Scroll?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:1 --&gt;Why Scroll?&lt;/h1&gt;
 &lt;br /&gt;
Sometimes we simply don&#039;t have enough room on a window for all of the controls needed by a program. We can get around this in several ways. One way is to move controls on and off the window as needed with the LOCATE statement. Another way is to make the controls do double duty. When one set of conditions is in effect, button one might be the &amp;quot;Okay&amp;quot; button, but when another set of conditions is in effect, it might be the &amp;quot;Save&amp;quot; button. This can get a little complicated! We can also break the program into logical parts and use separate windows to manage different tasks.&lt;br /&gt;
&lt;br /&gt;
Here is a new idea. We can scroll the controls on the window. If we allow scrolling, then more controls, or larger controls may fit on a single window.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:30:&amp;lt;img src=&amp;quot;/file/view/scrollmdi.jpg/267887354/scrollmdi.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/scrollmdi.jpg/267887354/scrollmdi.jpg&quot; alt=&quot;scrollmdi.jpg&quot; title=&quot;scrollmdi.jpg&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:30 --&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:3:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;MDI is the Key&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:3 --&gt;MDI is the Key&lt;/h1&gt;
 &lt;br /&gt;
We could go about the scrolling in several ways, but using an MDI client is probably the easiest way of all. An MDI application has an MDI client that acts as parent to any child windows it contains. When one of the child windows is larger than the workspace, the MDI window automatically adds scrollbars to allow access to the entire child window.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Creating an MDI Client&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;Creating an MDI Client&lt;/h1&gt;
 &lt;br /&gt;
As with other API-created controls, we create the MDI client with CreateWindowExA. It will itself be a child of our main program window, and it won&#039;t really be visible until it displays scrollbars. We need the handle of our program window, and the instance handle, which we retrieve with GetWindowLongA. We also fill arguments for the location and dimensions. See the sample program below, where all arguments for CreateWindowExA are documented.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Creating a Child Window&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;Creating a Child Window&lt;/h1&gt;
 &lt;br /&gt;
We&#039;ll need a child window to hold all of our controls. We don&#039;t want the user to move it around, so we&#039;ll create it with no titlebar using the window_popup style. We can make this window as large as we need to hold the controls, and of course we need to include commands to create these controls before the command to open the popup window. We&#039;ll locate the popup window so that it fills the client area of our main program window. Once this popup window is created, we&#039;ll make it a child of the MDI client with the SetParent function.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Making it Work&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Making it Work&lt;/h1&gt;
 &lt;br /&gt;
We need to check for the resize event of the window and resize the MDI client so that it fills the new workspace whenever the window changes size. If the user has scrolled the MDI window and then resizes the program window, the child popup will not be in the correct locatoin, so we&#039;ll also need to relocate our popup child window. We need to force a resize event when the window first opens so that the MDI scrollbars will display. We do all of these sizing and locating chores with MoveWindow.&lt;br /&gt;
&lt;br /&gt;
The demo below only has a single button on the far right side of the popup child window. Your own program would probably have many controls on this window.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Scrolling Demo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;Scrolling Demo&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;&#039;MDI window to allow&amp;lt;br/&amp;gt;&#039;scrolling of large window&amp;lt;br/&amp;gt;&#039;area&amp;lt;br/&amp;gt;&#039;based on work&amp;lt;br/&amp;gt;&#039;By Mitchell Kotler&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    WindowWidth=350 : WindowHeight=350&amp;lt;br/&amp;gt;    childWide=1400 : childHigh=1000 &#039;child window dims&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;menu #main, &amp;amp;quot;File&amp;amp;quot;, &amp;amp;quot;E&amp;amp;amp;xit&amp;amp;quot;,[quit]&amp;lt;br/&amp;gt;open &amp;amp;quot;Scrolling Big Window&amp;amp;quot; for window as #main&amp;lt;br/&amp;gt;print #main, &amp;amp;quot;trapclose [quit]&amp;amp;quot;&amp;lt;br/&amp;gt;print #main, &amp;amp;quot;resizehandler [resize]&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    hMain=hwnd(#main) &#039;main window handle&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    calldll #user32, &amp;amp;quot;GetWindowLongA&amp;amp;quot;,_&amp;lt;br/&amp;gt;        hMain as uLong,_         &#039;handle of window&amp;lt;br/&amp;gt;        _GWl_HINSTANCE as long,_ &#039;flag for instance handle&amp;lt;br/&amp;gt;        hInstance as uLONG       &#039;returns instance handle of window&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    dwStyle=_WS_CLIPCHILDREN OR _WS_CHILD OR _WS_VISIBLE OR _&amp;lt;br/&amp;gt;        _WS_BORDER or _WS_VSCROLL OR _WS_HSCROLL&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    &#039;create an MDI Client Control&amp;lt;br/&amp;gt;    calldll #user32, &amp;amp;quot;CreateWindowExA&amp;amp;quot;,_&amp;lt;br/&amp;gt;        0 as long,_             &#039;extended class style&amp;lt;br/&amp;gt;        &amp;amp;quot;MDICLIENT&amp;amp;quot; as ptr,_    &#039;class name&amp;lt;br/&amp;gt;        &amp;amp;quot;&amp;amp;quot; as ptr,_             &#039;title or string&amp;lt;br/&amp;gt;        dwStyle as long,_       &#039;window style&amp;lt;br/&amp;gt;        2 as long,_             &#039;x org&amp;lt;br/&amp;gt;        2 as long,_             &#039;y org&amp;lt;br/&amp;gt;        339 as long,_           &#039;width&amp;lt;br/&amp;gt;        302 as long,_           &#039;height&amp;lt;br/&amp;gt;        hMain as ulong,_        &#039;parent window&amp;lt;br/&amp;gt;        0 as ulong,_            &#039;handle to menu = 0 for class menu&amp;lt;br/&amp;gt;        hInstance as ulong,_    &#039;instance handle of parent window&amp;lt;br/&amp;gt;        &amp;amp;quot;&amp;amp;quot; as ptr,_             &#039;always NULL&amp;lt;br/&amp;gt;        hMDI as ulong           &#039;returns handle of MDI Client&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;WindowWidth=childWide:WindowHeight=childHigh&amp;lt;br/&amp;gt;statictext #child, &amp;amp;quot;Scroll Me A LOT!&amp;amp;quot;,10,10,200,24&amp;lt;br/&amp;gt;button #child.b, &amp;amp;quot;Click Me!&amp;amp;quot;,[doClick],UL,1200,100,100,24&amp;lt;br/&amp;gt;open &amp;amp;quot;&amp;amp;quot; for window_popup as #child&amp;lt;br/&amp;gt;print #child, &amp;amp;quot;trapclose [quit]&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    hChild=hwnd(#child) &#039;handle of popup window&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    calldll #user32, &amp;amp;quot;SetParent&amp;amp;quot;,_&amp;lt;br/&amp;gt;        hChild as ulong,_    &#039;make popup the child&amp;lt;br/&amp;gt;        hMDI as ulong,_      &#039;make MDI the parent&amp;lt;br/&amp;gt;        result as long&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    &#039;use MoveWindow to force window resize&amp;lt;br/&amp;gt;    &#039;so scrollbars will show&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;MoveWindow&amp;amp;quot;,hMain As uLong,_&amp;lt;br/&amp;gt;         11 As Long, 11 As Long,_&amp;lt;br/&amp;gt;         333 As Long, 333 As Long,_&amp;lt;br/&amp;gt;         1 As long, r As long&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[resize]&amp;lt;br/&amp;gt;    newWide=WindowWidth-4&amp;lt;br/&amp;gt;    newHigh=WindowHeight-4&amp;lt;br/&amp;gt;    ret=MoveWindow(hMDI,2,2,newWide,newHigh)&amp;lt;br/&amp;gt;    ret=MoveWindow(hChild,0,0,childWide,childHigh)&amp;lt;br/&amp;gt;    wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[doClick]&amp;lt;br/&amp;gt;    notice &amp;amp;quot;Thanks for clicking me!&amp;amp;quot;&amp;lt;br/&amp;gt;    wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[quit] close #child : close #main : end&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Function MoveWindow(hWnd,x,y,wide,high)&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;MoveWindow&amp;amp;quot;,_&amp;lt;br/&amp;gt;        hWnd As uLong,_         &#039;handle&amp;lt;br/&amp;gt;        x As Long, y As Long,_  &#039;x,y pos&amp;lt;br/&amp;gt;        wide As Long,_          &#039;width&amp;lt;br/&amp;gt;        high As Long,_          &#039;height&amp;lt;br/&amp;gt;        1 As long,_             &#039;repaint flag&amp;lt;br/&amp;gt;        MoveWindow As long&amp;lt;br/&amp;gt;    end function&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039;MDI window to allow&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;scrolling of large window&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;area&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;based on work&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;By Mitchell Kotler&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;nomainwin&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;350&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;350&lt;/span&gt;
    childWide&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1400&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; childHigh&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1000&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;child window dims&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;menu&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;File&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;E&amp;amp;xit&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;quit&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Scrolling Big Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;trapclose [quit]&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;resizehandler [resize]&amp;quot;&lt;/span&gt;
&amp;nbsp;
    hMain&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;hwnd&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;main window handle&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;calldll&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;user32&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;GetWindowLongA&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
        hMain &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;uLong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_         &lt;span class=&quot;co1&quot;&gt;&#039;handle of window&lt;/span&gt;
        _GWl_HINSTANCE &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_ &lt;span class=&quot;co1&quot;&gt;&#039;flag for instance handle&lt;/span&gt;
        hInstance &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;uLONG&lt;/span&gt;       &lt;span class=&quot;co1&quot;&gt;&#039;returns instance handle of window&lt;/span&gt;
&amp;nbsp;
    dwStyle&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;_WS_CLIPCHILDREN &lt;span class=&quot;kw1&quot;&gt;OR&lt;/span&gt; _WS_CHILD &lt;span class=&quot;kw1&quot;&gt;OR&lt;/span&gt; _WS_VISIBLE &lt;span class=&quot;kw1&quot;&gt;OR&lt;/span&gt; _
        _WS_BORDER &lt;span class=&quot;kw1&quot;&gt;or&lt;/span&gt; _WS_VSCROLL &lt;span class=&quot;kw1&quot;&gt;OR&lt;/span&gt; _WS_HSCROLL
&amp;nbsp;
    &lt;span class=&quot;co1&quot;&gt;&#039;create an MDI Client Control&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;calldll&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;user32&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;CreateWindowExA&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
        &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_             &lt;span class=&quot;co1&quot;&gt;&#039;extended class style&lt;/span&gt;
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;MDICLIENT&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_    &lt;span class=&quot;co1&quot;&gt;&#039;class name&lt;/span&gt;
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_             &lt;span class=&quot;co1&quot;&gt;&#039;title or string&lt;/span&gt;
        dwStyle &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_       &lt;span class=&quot;co1&quot;&gt;&#039;window style&lt;/span&gt;
        &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_             &lt;span class=&quot;co1&quot;&gt;&#039;x org&lt;/span&gt;
        &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_             &lt;span class=&quot;co1&quot;&gt;&#039;y org&lt;/span&gt;
        &lt;span class=&quot;nu0&quot;&gt;339&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_           &lt;span class=&quot;co1&quot;&gt;&#039;width&lt;/span&gt;
        &lt;span class=&quot;nu0&quot;&gt;302&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_           &lt;span class=&quot;co1&quot;&gt;&#039;height&lt;/span&gt;
        hMain &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ulong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_        &lt;span class=&quot;co1&quot;&gt;&#039;parent window&lt;/span&gt;
        &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ulong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_            &lt;span class=&quot;co1&quot;&gt;&#039;handle to menu = 0 for class menu&lt;/span&gt;
        hInstance &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ulong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_    &lt;span class=&quot;co1&quot;&gt;&#039;instance handle of parent window&lt;/span&gt;
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_             &lt;span class=&quot;co1&quot;&gt;&#039;always NULL&lt;/span&gt;
        hMDI &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ulong&lt;/span&gt;           &lt;span class=&quot;co1&quot;&gt;&#039;returns handle of MDI Client&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;childWide&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;childHigh
&lt;span class=&quot;kw1&quot;&gt;statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;child&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Scroll Me A LOT!&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;child.b&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Click Me!&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;doClick&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1200&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; window_popup &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;child
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;child&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;trapclose [quit]&amp;quot;&lt;/span&gt;
&amp;nbsp;
    hChild&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;hwnd&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;child&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;handle of popup window&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;calldll&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;user32&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;SetParent&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
        hChild &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ulong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_    &lt;span class=&quot;co1&quot;&gt;&#039;make popup the child&lt;/span&gt;
        hMDI &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ulong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_      &lt;span class=&quot;co1&quot;&gt;&#039;make MDI the parent&lt;/span&gt;
        result &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;co1&quot;&gt;&#039;use MoveWindow to force window resize&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;&#039;so scrollbars will show&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;CallDLL&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;user32&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;MoveWindow&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;hMain &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;uLong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
         &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
         &lt;span class=&quot;nu0&quot;&gt;333&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;333&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
         &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; r &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;resize&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
    newWide&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;WindowWidth&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;
    newHigh&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;WindowHeight&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;
    ret&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;MoveWindow&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hMDI&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;newWide&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;newHigh&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    ret&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;MoveWindow&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hChild&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;childWide&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;childHigh&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;doClick&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;notice&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Thanks for clicking me!&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;quit&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;close&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;child &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;close&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;end&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; MoveWindow&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hWnd&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;x&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;y&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;wide&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;high&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;CallDLL&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;user32&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;MoveWindow&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
        hWnd &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;uLong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_         &lt;span class=&quot;co1&quot;&gt;&#039;handle&lt;/span&gt;
        x &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; y &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_  &lt;span class=&quot;co1&quot;&gt;&#039;x,y pos&lt;/span&gt;
        wide &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_          &lt;span class=&quot;co1&quot;&gt;&#039;width&lt;/span&gt;
        high &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_          &lt;span class=&quot;co1&quot;&gt;&#039;height&lt;/span&gt;
        &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_             &lt;span class=&quot;co1&quot;&gt;&#039;repaint flag&lt;/span&gt;
        MoveWindow &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;function&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;!-- ws:start:WikiTextTocRule:21:&amp;lt;img id=&amp;quot;wikitext@@toc@@flat&amp;quot; class=&amp;quot;WikiMedia WikiMediaTocFlat&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/flat?w=100&amp;amp;h=16&amp;quot;/&amp;gt; --&gt;&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextTocRule:22: --&gt;&lt;a href=&quot;#Why Scroll?&quot;&gt;Why Scroll?&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;!-- ws:start:WikiTextTocRule:23: --&gt; | &lt;a href=&quot;#MDI is the Key&quot;&gt;MDI is the Key&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt; | &lt;a href=&quot;#Creating an MDI Client&quot;&gt;Creating an MDI Client&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt; | &lt;a href=&quot;#Creating a Child Window&quot;&gt;Creating a Child Window&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt; | &lt;a href=&quot;#Making it Work&quot;&gt;Making it Work&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt; | &lt;a href=&quot;#Scrolling Demo&quot;&gt;Scrolling Demo&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt;
&lt;!-- ws:end:WikiTextTocRule:28 --&gt;</description>
          </item>
    <item>
      <title>MoveWindow</title>
      <link>https://lbpe.wikispaces.com/MoveWindow</link>
      <dc:creator>StPendl</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/MoveWindow</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/MoveWindow</comments>
      <pubDate>Sun, 02 Jan 2011 16:29:40 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:13:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:13 --&gt;&lt;!-- ws:start:WikiTextTocRule:14: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Moving or Resizing a Window or Control&quot;&gt;Moving or Resizing a Window or Control&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:14 --&gt;&lt;!-- ws:start:WikiTextTocRule:15: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Moving or Resizing a Window or Control-Native LOCATE Command&quot;&gt;Native LOCATE Command&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:15 --&gt;&lt;!-- ws:start:WikiTextTocRule:16: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Moving or Resizing a Window or Control-MoveWindow API&quot;&gt;MoveWindow API&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:16 --&gt;&lt;!-- ws:start:WikiTextTocRule:17: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Moving or Resizing a Window or Control-Demo&quot;&gt;Demo&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:17 --&gt;&lt;!-- ws:start:WikiTextTocRule:18: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:18 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Moving or Resizing a Window or Control&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;Moving or Resizing a Window or Control&lt;/h1&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Moving or Resizing a Window or Control-Native LOCATE Command&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;Native LOCATE Command&lt;/h2&gt;
Liberty BASIC includes a &amp;quot;LOCATE&amp;quot; command for moving and resizing controls. This command only works on controls and it only works in windows of type &amp;quot;WINDOW.&amp;quot;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;nomainwin&amp;lt;br/&amp;gt;button #main.b, &amp;amp;quot;Move Me&amp;amp;quot;,[moveMe],UL,10,10,100,30&amp;lt;br/&amp;gt;open &amp;amp;quot;Move a Button&amp;amp;quot; for window as #main&amp;lt;br/&amp;gt;#main &amp;amp;quot;trapclose [quit]&amp;amp;quot;&amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[quit] close #main:end&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[moveMe]&amp;lt;br/&amp;gt;#main.b &amp;amp;quot;!locate 50 100 200 50&amp;amp;quot;&amp;lt;br/&amp;gt;#main.b &amp;amp;quot;I&#039;ve been moved!&amp;amp;quot;&amp;lt;br/&amp;gt;#main &amp;amp;quot;refresh&amp;amp;quot;&amp;lt;br/&amp;gt;wait&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;nomainwin&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.b&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Move Me&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;moveMe&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Move a Button&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main &lt;span class=&quot;st0&quot;&gt;&amp;quot;trapclose [quit]&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;quit&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;close&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;end&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;moveMe&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.b &lt;span class=&quot;st0&quot;&gt;&amp;quot;!locate 50 100 200 50&amp;quot;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.b &lt;span class=&quot;st0&quot;&gt;&amp;quot;I&#039;ve been moved!&amp;quot;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main &lt;span class=&quot;st0&quot;&gt;&amp;quot;refresh&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;When the &amp;quot;LOCATE&amp;quot; command is sent to a control that can accept a new label or text, we must precede the command with a ! character as we did above, or the command string is simply displayed on the control and not acted on. Note the difference in the two lines below. The first line is a command that instructs the button to change its size and location. The second line changes the caption on the button.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;#main.b &amp;amp;quot;!locate 50 100 200 50&amp;amp;quot;&amp;lt;br/&amp;gt;#main.b &amp;amp;quot;I&#039;ve been moved!&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.b &lt;span class=&quot;st0&quot;&gt;&amp;quot;!locate 50 100 200 50&amp;quot;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.b &lt;span class=&quot;st0&quot;&gt;&amp;quot;I&#039;ve been moved!&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
Don&#039;t forget to issue a &amp;quot;REFRESH&amp;quot; command to cause the window display to be updated after moving a control.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Moving or Resizing a Window or Control-MoveWindow API&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;MoveWindow API&lt;/h2&gt;
We can move and resize any window or control with the MoveWindow API call. The coordinates for the x and y locations of a window are relative to the upper left corner of the desktop. If the API call is used to move or resize a control, the coordinates are relative to the upper left corner of the window&#039;s workspace, which is called the Client Area.&lt;br /&gt;
&lt;br /&gt;
Liberty BASIC does not currently have a native function for moving or resizing an open window. It also does not allow us to move or resize controls contained in windows that are not of type &amp;quot;WINDOW.&amp;quot; We must use an API call to change the location and size of windows and of controls not in &amp;quot;WINDOW&amp;quot; type windows. \&lt;br /&gt;
To move or resize a window, use the handle of the window obtained with the HWND() function.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;    hMain = HWND(#main)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    calldll #user32, &amp;amp;quot;MoveWindow&amp;amp;quot;,_&amp;lt;br/&amp;gt;    hMain as ulong, _       &#039;window handle&amp;lt;br/&amp;gt;    10 as long,_            &#039;x location of window&amp;lt;br/&amp;gt;    20 as long,_            &#039;y location of window&amp;lt;br/&amp;gt;    730 as long,_           &#039;desired width of window&amp;lt;br/&amp;gt;    590 as long,_           &#039;desired height of window&amp;lt;br/&amp;gt;    1 as long,_             &#039;repaint flag,0=false,1=true&amp;lt;br/&amp;gt;    ret as long             &#039;nonzero=success&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;    hMain &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;HWND&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;calldll&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;user32&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;MoveWindow&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
    hMain &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ulong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _       &lt;span class=&quot;co1&quot;&gt;&#039;window handle&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_            &lt;span class=&quot;co1&quot;&gt;&#039;x location of window&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_            &lt;span class=&quot;co1&quot;&gt;&#039;y location of window&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;730&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_           &lt;span class=&quot;co1&quot;&gt;&#039;desired width of window&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;590&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_           &lt;span class=&quot;co1&quot;&gt;&#039;desired height of window&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_             &lt;span class=&quot;co1&quot;&gt;&#039;repaint flag,0=false,1=true&lt;/span&gt;
    ret &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;             &lt;span class=&quot;co1&quot;&gt;&#039;nonzero=success&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;br /&gt;
To move or resize a control, use the handle of the control obtained with the HWND() function.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;hButton = HWND(#main.b)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;calldll #user32, &amp;amp;quot;MoveWindow&amp;amp;quot;,_&amp;lt;br/&amp;gt;    hButton as ulong, _     &#039;control handle&amp;lt;br/&amp;gt;    50 as long,_            &#039;x location of control&amp;lt;br/&amp;gt;    150 as long,_            &#039;y location of control&amp;lt;br/&amp;gt;    200 as long,_           &#039;desired width of control&amp;lt;br/&amp;gt;    50 as long,_            &#039;desired height of control&amp;lt;br/&amp;gt;    1 as long,_             &#039;repaint flag,0=false,1=true&amp;lt;br/&amp;gt;    ret as long             &#039;nonzero=success&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;hButton &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;HWND&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;calldll&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;user32&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;MoveWindow&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
    hButton &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ulong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _     &lt;span class=&quot;co1&quot;&gt;&#039;control handle&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_            &lt;span class=&quot;co1&quot;&gt;&#039;x location of control&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_            &lt;span class=&quot;co1&quot;&gt;&#039;y location of control&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_           &lt;span class=&quot;co1&quot;&gt;&#039;desired width of control&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_            &lt;span class=&quot;co1&quot;&gt;&#039;desired height of control&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_             &lt;span class=&quot;co1&quot;&gt;&#039;repaint flag,0=false,1=true&lt;/span&gt;
    ret &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;             &lt;span class=&quot;co1&quot;&gt;&#039;nonzero=success&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Moving or Resizing a Window or Control-Demo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;Demo&lt;/h2&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;nomainwin&amp;lt;br/&amp;gt;button #main.b, &amp;amp;quot;Move Me&amp;amp;quot;,[moveMe],UL,10,10,100,30&amp;lt;br/&amp;gt;button #main.move, &amp;amp;quot;Move Window&amp;amp;quot;,[moveWindow],UL,120,10,100,30&amp;lt;br/&amp;gt;open &amp;amp;quot;Move a Button&amp;amp;quot; for window as #main&amp;lt;br/&amp;gt;#main &amp;amp;quot;trapclose [quit]&amp;amp;quot;&amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[quit] close #main:end&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[moveMe]&amp;lt;br/&amp;gt;#main.b &amp;amp;quot;I&#039;ve been moved!&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;hButton = HWND(#main.b)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;calldll #user32, &amp;amp;quot;MoveWindow&amp;amp;quot;,_&amp;lt;br/&amp;gt;    hButton as ulong, _     &#039;control handle&amp;lt;br/&amp;gt;    50 as long,_            &#039;x location of control&amp;lt;br/&amp;gt;    150 as long,_           &#039;y location of control&amp;lt;br/&amp;gt;    200 as long,_           &#039;desired width of control&amp;lt;br/&amp;gt;    50 as long,_            &#039;desired height of control&amp;lt;br/&amp;gt;    1 as long,_             &#039;repaint flag,0=false,1=true&amp;lt;br/&amp;gt;    ret as long             &#039;nonzero=success&amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[moveWindow]&amp;lt;br/&amp;gt;    hMain = HWND(#main)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    calldll #user32, &amp;amp;quot;MoveWindow&amp;amp;quot;,_&amp;lt;br/&amp;gt;    hMain as ulong, _       &#039;window handle&amp;lt;br/&amp;gt;    10 as long,_            &#039;x location of window&amp;lt;br/&amp;gt;    20 as long,_            &#039;y location of window&amp;lt;br/&amp;gt;    730 as long,_           &#039;desired width of window&amp;lt;br/&amp;gt;    590 as long,_           &#039;desired height of window&amp;lt;br/&amp;gt;    1 as long,_             &#039;repaint flag,0=false,1=true&amp;lt;br/&amp;gt;    ret as long             &#039;nonzero=success&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    &#039;we&#039;ll only move window once, then disable button &amp;lt;br/&amp;gt;    #main.move &amp;amp;quot;!disable&amp;amp;quot; &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;nomainwin&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.b&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Move Me&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;moveMe&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.move&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Move Window&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;moveWindow&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Move a Button&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main &lt;span class=&quot;st0&quot;&gt;&amp;quot;trapclose [quit]&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;quit&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;close&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;end&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;moveMe&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.b &lt;span class=&quot;st0&quot;&gt;&amp;quot;I&#039;ve been moved!&amp;quot;&lt;/span&gt;
&amp;nbsp;
hButton &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;HWND&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;calldll&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;user32&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;MoveWindow&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
    hButton &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ulong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _     &lt;span class=&quot;co1&quot;&gt;&#039;control handle&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_            &lt;span class=&quot;co1&quot;&gt;&#039;x location of control&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_           &lt;span class=&quot;co1&quot;&gt;&#039;y location of control&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_           &lt;span class=&quot;co1&quot;&gt;&#039;desired width of control&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_            &lt;span class=&quot;co1&quot;&gt;&#039;desired height of control&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_             &lt;span class=&quot;co1&quot;&gt;&#039;repaint flag,0=false,1=true&lt;/span&gt;
    ret &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;             &lt;span class=&quot;co1&quot;&gt;&#039;nonzero=success&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;moveWindow&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
    hMain &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;HWND&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;calldll&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;user32&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;MoveWindow&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
    hMain &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;ulong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _       &lt;span class=&quot;co1&quot;&gt;&#039;window handle&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_            &lt;span class=&quot;co1&quot;&gt;&#039;x location of window&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_            &lt;span class=&quot;co1&quot;&gt;&#039;y location of window&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;730&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_           &lt;span class=&quot;co1&quot;&gt;&#039;desired width of window&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;590&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_           &lt;span class=&quot;co1&quot;&gt;&#039;desired height of window&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_             &lt;span class=&quot;co1&quot;&gt;&#039;repaint flag,0=false,1=true&lt;/span&gt;
    ret &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;             &lt;span class=&quot;co1&quot;&gt;&#039;nonzero=success&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;co1&quot;&gt;&#039;we&#039;ll only move window once, then disable button &lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.move &lt;span class=&quot;st0&quot;&gt;&amp;quot;!disable&amp;quot;&lt;/span&gt; 
&amp;nbsp;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;</description>
          </item>
    <item>
      <title>PushButtons</title>
      <link>https://lbpe.wikispaces.com/PushButtons</link>
      <dc:creator>Alyce</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/PushButtons</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/PushButtons</comments>
      <pubDate>Wed, 22 Jun 2011 13:18:05 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:12:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Push Buttons&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:12 --&gt;Push Buttons&lt;/h1&gt;
&lt;!-- ws:start:WikiTextUserlinkRule:012:[[user:Alyce]] --&gt;&lt;span class=&quot;membersnap&quot;&gt;- &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;&lt;img src=&quot;https://www.wikispaces.com/user/pic/Alyce-lg.jpg&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Alyce&quot; class=&quot;userPicture&quot; /&gt;&lt;/a&gt; &lt;a class=&quot;userLink&quot; href=&quot;https://www.wikispaces.com/user/view/Alyce&quot; style=&quot;outline: none;&quot;&gt;Alyce&lt;/a&gt;&lt;/span&gt;&lt;!-- ws:end:WikiTextUserlinkRule:012 --&gt;&lt;br /&gt;
from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://alycesrestaurant.com/companion.htm&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC 4 Companion&lt;/a&gt;&lt;br /&gt;
© 2011, Alyce Watson. All rights reserved.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextTocRule:36:&amp;lt;img id=&amp;quot;wikitext@@toc@@flat&amp;quot; class=&amp;quot;WikiMedia WikiMediaTocFlat&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/flat?w=100&amp;amp;h=16&amp;quot;/&amp;gt; --&gt;&lt;!-- ws:end:WikiTextTocRule:36 --&gt;&lt;!-- ws:start:WikiTextTocRule:37: --&gt;&lt;a href=&quot;#Push Buttons&quot;&gt;Push Buttons&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:37 --&gt;&lt;!-- ws:start:WikiTextTocRule:38: --&gt; | &lt;a href=&quot;#Button&quot;&gt;Button&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:38 --&gt;&lt;!-- ws:start:WikiTextTocRule:39: --&gt; | &lt;a href=&quot;#Default Button&quot;&gt;Default Button&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:39 --&gt;&lt;!-- ws:start:WikiTextTocRule:40: --&gt; | &lt;a href=&quot;#Non-literals in Button Statements&quot;&gt;Non-literals in Button Statements&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:40 --&gt;&lt;!-- ws:start:WikiTextTocRule:41: --&gt; | &lt;a href=&quot;#EVENT HANDLERS&quot;&gt;EVENT HANDLERS&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:41 --&gt;&lt;!-- ws:start:WikiTextTocRule:42: --&gt; | &lt;a href=&quot;#COLORS&quot;&gt;COLORS&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:42 --&gt;&lt;!-- ws:start:WikiTextTocRule:43: --&gt; | &lt;a href=&quot;#LABEL&quot;&gt;LABEL&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:43 --&gt;&lt;!-- ws:start:WikiTextTocRule:44: --&gt; | &lt;a href=&quot;#FONTS&quot;&gt;FONTS&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:44 --&gt;&lt;!-- ws:start:WikiTextTocRule:45: --&gt; | &lt;a href=&quot;#SETFOCUS&quot;&gt;SETFOCUS&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:45 --&gt;&lt;!-- ws:start:WikiTextTocRule:46: --&gt; | &lt;a href=&quot;#LOCATE&quot;&gt;LOCATE&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:46 --&gt;&lt;!-- ws:start:WikiTextTocRule:47: --&gt; | &lt;a href=&quot;#SHOW/HIDE&quot;&gt;SHOW/HIDE&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:47 --&gt;&lt;!-- ws:start:WikiTextTocRule:48: --&gt; | &lt;a href=&quot;#ENABLE/DISABLE&quot;&gt;ENABLE/DISABLE&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:48 --&gt;&lt;!-- ws:start:WikiTextTocRule:49: --&gt;
&lt;!-- ws:end:WikiTextTocRule:49 --&gt;&lt;hr /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:14:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Button&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:14 --&gt;Button&lt;/h1&gt;
A push button is a regular button. The user clicks on it to interact with a program. The button on the right in the image below is a push button.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:66:&amp;lt;img src=&amp;quot;/file/view/bmpbutton.JPG/238005303/bmpbutton.JPG&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/bmpbutton.JPG/238005303/bmpbutton.JPG&quot; alt=&quot;bmpbutton.JPG&quot; title=&quot;bmpbutton.JPG&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:66 --&gt;&lt;br /&gt;
&lt;br /&gt;
As with all other controls, buttons must be listed in the code before the window is opened. There are two kinds of buttons in Liberty BASIC, (regular) push buttons and BMPBUTTONS. The command to create push buttons must begin with the window handle, then a dot and a unique extension. Although the use of an extension is optional, omitting it isn&#039;t recommended, since that limits the program&#039;s ability to send commands to the button. In the following example, the window handle is &amp;quot;#1,&amp;quot; and the extension for this button is &amp;quot;.button1&amp;quot;  Here is the format to include a button:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;BUTTON #1.button1, &amp;amp;quot;I&#039;m a Button!&amp;amp;quot;, [branchLabel], UL, _&amp;lt;br/&amp;gt;    xpos, ypos, width, height&amp;lt;br/&amp;gt;or&amp;lt;br/&amp;gt;BUTTON #1.button1, &amp;amp;quot;I&#039;m a Button!&amp;amp;quot;, subName, UL, _&amp;lt;br/&amp;gt;    xpos, ypos, width, height&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;BUTTON&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;I&#039;m a Button!&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;branchLabel&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _
    xpos&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; ypos&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; width&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; height
&lt;span class=&quot;kw1&quot;&gt;or&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;BUTTON&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;I&#039;m a Button!&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; subName&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _
    xpos&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; ypos&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; width&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; height&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
The label that appears on the button is written between the quotation marks.  &lt;br /&gt;
&lt;br /&gt;
After the button label, the button command must specify the branch label or sub name in the program where execution should continue when the button is pushed by the user. [branchLabel] or subName &lt;br /&gt;
&lt;br /&gt;
The UL designates a corner of the client area. (Client area is the area of the window that does not include the titlebar, menu or frame - the workspace of the window.)  UL stands for upper left. The button appears at a distance specified from the upper left corner. The other possibilities are UR (upper right,) LL (lower left,) and LR (lower right.)  &lt;br /&gt;
&lt;br /&gt;
The next number is the X position in relationship to the corner specified. The following number is the Y position. &lt;br /&gt;
&lt;br /&gt;
The last two numbers are optional. Use them to specify the desired width and height of the button for a uniform look to the buttons in a window.  If the program does not specify dimensions, the button is sized automatically to the correct width and height for the label and font size chosen. If the font size of a button is changed during program execution, it may be necessary to change the size of the button also with the LOCATE command, since Liberty BASIC does not automatically resize the button. &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:16:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Default Button&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:16 --&gt;Default Button&lt;/h1&gt;
To create a button in a dialog window that will be activated when the user pushes ENTER, give it the extension DEFAULT as in this example:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;button #1.default, &amp;amp;quot;OK&amp;amp;quot;,[do.it],UL,10,300&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.default&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;OK&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;.it&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;300&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:18:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Non-literals in Button Statements&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:18 --&gt;Non-literals in Button Statements&lt;/h1&gt;
 Expressions and variables are also acceptable as parameters in the BUTTON command.  Some examples follow.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;buttonwidth = 2*60&amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;button #1.1, &amp;amp;quot;Open&amp;amp;quot;,[open],UL,10,20,buttonwidth,40&amp;lt;br/&amp;gt;button #1.1, &amp;amp;quot;Edit&amp;amp;quot;,[edit],UL,200,20,buttonwidth,40&amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;width = 60&amp;lt;br/&amp;gt;height = 25&amp;lt;br/&amp;gt;xOrigin = 10&amp;lt;br/&amp;gt;yOrigin = 10&amp;lt;br/&amp;gt;label$ = &amp;amp;quot;Button&amp;amp;quot;&amp;lt;br/&amp;gt;bitmapFile$ = &amp;amp;quot;run.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;button #main.sized, label$+&amp;amp;quot; Label!&amp;amp;quot;, [click], UL,_&amp;lt;br/&amp;gt;    xOrigin+60, yOrigin, width*3, height&amp;lt;br/&amp;gt;bmpbutton #main.run, bitmapFile$, [run], UL, xOrigin, yOrigin&amp;lt;br/&amp;gt;bmpbutton #main.bug, &amp;amp;quot;bug.bmp&amp;amp;quot;, [bug], UL, xOrigin, yOrigin * 4&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;buttonwidth &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1.1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Open&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;buttonwidth&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1.1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Edit&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;edit&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;buttonwidth&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
&amp;nbsp;
width &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;
height &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt;
xOrigin &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
yOrigin &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
label$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button&amp;quot;&lt;/span&gt;
bitmapFile$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;run.bmp&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.sized&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; label$&lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot; Label!&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;click&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
    xOrigin&lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; yOrigin&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; width&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; height
&lt;span class=&quot;kw1&quot;&gt;bmpbutton&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.&lt;span class=&quot;kw1&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; bitmapFile$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; xOrigin&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; yOrigin
&lt;span class=&quot;kw1&quot;&gt;bmpbutton&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.bug&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;bug.bmp&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;bug&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; xOrigin&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; yOrigin &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:20:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;EVENT HANDLERS&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:20 --&gt;EVENT HANDLERS&lt;/h1&gt;
Both branch labels and subs can be used to handle button events. If a sub is used, the handle of the button is passed into the sub by Liberty BASIC. It is passed in as a string variable. Refer to it by placing the # character in front of this handle variable, as in the demo below:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;button #1.b, &amp;amp;quot;Click Me&amp;amp;quot;,clickMe,UL,10,10&amp;lt;br/&amp;gt;button #1.c, &amp;amp;quot;Pick Me&amp;amp;quot;,[pick],UL,10,60&amp;lt;br/&amp;gt;open &amp;amp;quot;duh&amp;amp;quot; for window as #1&amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;[pick]&amp;lt;br/&amp;gt;&#039;enable the other button&amp;lt;br/&amp;gt;#1.b &amp;amp;quot;!enable&amp;amp;quot;&amp;lt;br/&amp;gt;wait&amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;Sub clickMe handle$&amp;lt;br/&amp;gt;&#039;send a command to this button&amp;lt;br/&amp;gt;&#039;using handle variable&amp;lt;br/&amp;gt;#handle$ &amp;amp;quot;!disable&amp;amp;quot;&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.b&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Click Me&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;clickMe&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.c&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Pick Me&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;pick&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;duh&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;pick&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;enable the other button&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.b &lt;span class=&quot;st0&quot;&gt;&amp;quot;!enable&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; clickMe handle$
&lt;span class=&quot;co1&quot;&gt;&#039;send a command to this button&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;using handle variable&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;handle$ &lt;span class=&quot;st0&quot;&gt;&amp;quot;!disable&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:22:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;COLORS&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:22 --&gt;COLORS&lt;/h1&gt;
The background color of a button is a system color. It cannot be changed by Liberty BASIC. The user&#039;s default system color for this is called BUTTONFACE by Liberty BASIC. It is not possible to change the color of the text displayed on the button.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:24:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;LABEL&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:24 --&gt;LABEL&lt;/h1&gt;
The label of a push button can be changed in the course of running the program. Bmpbuttons do not have labels. To change the label on a button, use this command:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;print #1.button1, &amp;amp;quot;Changed!&amp;amp;quot;&amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;or&amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;caption$=&amp;amp;quot;Changed!&amp;amp;quot;&amp;lt;br/&amp;gt;print #1.button1, caption$&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Changed!&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;or&lt;/span&gt;
&amp;nbsp;
caption$&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;Changed!&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; caption$&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;br /&gt;
After the command is carried out, the button caption displays the text supplied in the PRINT command.  (Changed!)&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:26:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;FONTS&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:26 --&gt;FONTS&lt;/h1&gt;
The default font for controls is Ms Sans Serif 8 point. This is the same font most Windows applications use. A program may change the font that is displayed on buttons.  Bmpbuttons cannot accept a FONT command.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;print #window.bttn, &amp;amp;quot;!font facename width height [attributes]&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;window.bttn&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;!font facename width height [attributes]&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;br /&gt;
First designate the font name, then the desired width and height of the font characters in pixels. If the command designates a value of 0 for the width, Liberty BASIC automatically supplies the default width for the chosen font. If a value (or 0) is given for width, the font is sized in pixels. If there is no width parameter specified, the font is sized in points. There are 72 points in an inch.  &lt;br /&gt;
&lt;br /&gt;
Possible attributes are bold, underscore, italic and strikeout.  They may be used in any combination and listed in any order. Adding attributes is completely optional.&lt;br /&gt;
&lt;br /&gt;
If the program cannot match the font exactly, it provides the closest font matching the one specified. If the desired font name contains blank spaces, you must use an underscore character in place of the spaces when specifying the face name. Both facename and attributes are case insensitive, so &amp;quot;Arial&amp;quot; is the same as &amp;quot;arial&amp;quot; and &amp;quot;ARIAL.&amp;quot; &amp;quot;BOLD&amp;quot; is the same as &amp;quot;bolD&amp;quot; and &amp;quot;Bold.&amp;quot;  Here&#039;s the button font command as it appears in a program:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;print #1.button1, &amp;amp;quot;!font Times_New_Roman 0 20 bold&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;!font Times_New_Roman 0 20 bold&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:28:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;SETFOCUS&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:28 --&gt;SETFOCUS&lt;/h1&gt;
To cause a button to receive the input focus, issue a !SETFOCUS command:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;print #1.button1, &amp;amp;quot;!setfocus&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;!setfocus&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:30:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc9&quot;&gt;&lt;a name=&quot;LOCATE&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:30 --&gt;LOCATE&lt;/h1&gt;
It is possible to move or resize a button during program execution with the LOCATE statement. After the locate command is sent to the button, always send a REFRESH command to the window itself, so that the screen is redrawn to reflect the change. The format is:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;print #1.button1, &amp;amp;quot;locate X Y Width Height&amp;amp;quot;&amp;lt;br/&amp;gt;print #1, &amp;amp;quot;refresh&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;locate X Y Width Height&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;refresh&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;br /&gt;
In a program, it looks like this:  &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;print #1.button1, &amp;amp;quot;locate 20 400 100 30&amp;amp;quot;&amp;lt;br/&amp;gt;print #1.button2, &amp;amp;quot;locate 20 400 &amp;amp;quot;;buttonwidth;&amp;amp;quot; &amp;amp;quot;;buttonheight&amp;lt;br/&amp;gt;print #1, &amp;amp;quot;refresh&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;locate 20 400 100 30&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;locate 20 400 &amp;quot;&lt;/span&gt;;buttonwidth;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;buttonheight
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;refresh&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:32:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc10&quot;&gt;&lt;a name=&quot;SHOW/HIDE&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:32 --&gt;SHOW/HIDE&lt;/h1&gt;
To hide a button or show a button:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;print #1.button1, &amp;amp;quot;!show&amp;amp;quot;&amp;lt;br/&amp;gt;print #1.button2, &amp;amp;quot;!hide&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;!show&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;!hide&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:34:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc11&quot;&gt;&lt;a name=&quot;ENABLE/DISABLE&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:34 --&gt;ENABLE/DISABLE&lt;/h1&gt;
A button can be disabled, so that it appears grayed-out and the user cannot click it. It can be enabled again with the ENABLE command:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;print #1.button1, &amp;amp;quot;!enable&amp;amp;quot;&amp;lt;br/&amp;gt;print #1.button2, &amp;amp;quot;!disable&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;!enable&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.button2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;!disable&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;&lt;hr /&gt;
&lt;!-- ws:start:WikiTextTocRule:50:&amp;lt;img id=&amp;quot;wikitext@@toc@@flat&amp;quot; class=&amp;quot;WikiMedia WikiMediaTocFlat&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/flat?w=100&amp;amp;h=16&amp;quot;/&amp;gt; --&gt;&lt;!-- ws:end:WikiTextTocRule:50 --&gt;&lt;!-- ws:start:WikiTextTocRule:51: --&gt;&lt;a href=&quot;#Push Buttons&quot;&gt;Push Buttons&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:51 --&gt;&lt;!-- ws:start:WikiTextTocRule:52: --&gt; | &lt;a href=&quot;#Button&quot;&gt;Button&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:52 --&gt;&lt;!-- ws:start:WikiTextTocRule:53: --&gt; | &lt;a href=&quot;#Default Button&quot;&gt;Default Button&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:53 --&gt;&lt;!-- ws:start:WikiTextTocRule:54: --&gt; | &lt;a href=&quot;#Non-literals in Button Statements&quot;&gt;Non-literals in Button Statements&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:54 --&gt;&lt;!-- ws:start:WikiTextTocRule:55: --&gt; | &lt;a href=&quot;#EVENT HANDLERS&quot;&gt;EVENT HANDLERS&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:55 --&gt;&lt;!-- ws:start:WikiTextTocRule:56: --&gt; | &lt;a href=&quot;#COLORS&quot;&gt;COLORS&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:56 --&gt;&lt;!-- ws:start:WikiTextTocRule:57: --&gt; | &lt;a href=&quot;#LABEL&quot;&gt;LABEL&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:57 --&gt;&lt;!-- ws:start:WikiTextTocRule:58: --&gt; | &lt;a href=&quot;#FONTS&quot;&gt;FONTS&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:58 --&gt;&lt;!-- ws:start:WikiTextTocRule:59: --&gt; | &lt;a href=&quot;#SETFOCUS&quot;&gt;SETFOCUS&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:59 --&gt;&lt;!-- ws:start:WikiTextTocRule:60: --&gt; | &lt;a href=&quot;#LOCATE&quot;&gt;LOCATE&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:60 --&gt;&lt;!-- ws:start:WikiTextTocRule:61: --&gt; | &lt;a href=&quot;#SHOW/HIDE&quot;&gt;SHOW/HIDE&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:61 --&gt;&lt;!-- ws:start:WikiTextTocRule:62: --&gt; | &lt;a href=&quot;#ENABLE/DISABLE&quot;&gt;ENABLE/DISABLE&lt;/a&gt;&lt;!-- ws:end:WikiTextTocRule:62 --&gt;&lt;!-- ws:start:WikiTextTocRule:63: --&gt;
&lt;!-- ws:end:WikiTextTocRule:63 --&gt;</description>
          </item>
    <item>
      <title>Retrieving Information from Textboxes</title>
      <link>https://lbpe.wikispaces.com/Retrieving+Information+from+Textboxes</link>
      <dc:creator>JanetTerra</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/Retrieving+Information+from+Textboxes</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/Retrieving+Information+from+Textboxes</comments>
      <pubDate>Fri, 27 Aug 2010 02:42:34 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x-Retrieving Information from Textboxes with SendMessageA&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Retrieving Information from Textboxes with SendMessageA&lt;/h2&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x-Retrieving Information from Textboxes with SendMessageA-The Native Liberty BASIC Command&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;The Native Liberty BASIC Command&lt;/h3&gt;
&lt;!-- ws:start:WikiTextTocRule:23:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#x-Retrieving Information from Textboxes with SendMessageA&quot;&gt;Retrieving Information from Textboxes with SendMessageA&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-Retrieving Information from Textboxes with SendMessageA-The Native Liberty BASIC Command&quot;&gt;The Native Liberty BASIC Command&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-Retrieving Information from Textboxes with SendMessageA-A Multiline Textbox&quot;&gt;A Multiline Textbox&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-Retrieving Information from Textboxes with SendMessageA-CallDLL #user32, &amp;quot;SendMessageA&amp;quot;&quot;&gt;CallDLL #user32, &amp;quot;SendMessageA&amp;quot;&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-Retrieving Information from Textboxes with SendMessageA-Get the Number of Lines in the Textbox&quot;&gt;Get the Number of Lines in the Textbox&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-Retrieving Information from Textboxes with SendMessageA-Get the Number of Characters in Each Line of Text&quot;&gt;Get the Number of Characters in Each Line of Text&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#x-Retrieving Information from Textboxes with SendMessageA-Liberty BASIC&#039;s Mid$() Function&quot;&gt;Liberty BASIC&#039;s Mid$() Function&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;br /&gt;
Liberty BASIC has a native command for retrieving textbox contents -&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;Print #main.tbx1, &amp;amp;quot;!Contents? text$&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;Print #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tbx1&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? text$&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;In most instances, this is all the code programs require.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    WindowWidth = 400&amp;lt;br/&amp;gt;    WindowHeight = 300&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth) /2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight) /2)&amp;lt;br/&amp;gt;    Statictext #main.stx1, &amp;amp;quot;What is your name?&amp;amp;quot;, 20, 34, 70, 60&amp;lt;br/&amp;gt;    Textbox #main.tbx1, 100, 50, 200, 30&amp;lt;br/&amp;gt;    Button #main.default, &amp;amp;quot; OK &amp;amp;quot;, GetName, UL, 320, 50&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Retrieving Textbox Contents&amp;amp;quot; for Dialog as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose XbyTrap&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub XbyTrap handle$&amp;lt;br/&amp;gt;    Close #handle$&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub GetName handle$&amp;lt;br/&amp;gt;    #main.tbx1 &amp;amp;quot;!Contents? name$&amp;amp;quot;&amp;lt;br/&amp;gt;    Notice &amp;amp;quot;Hello, &amp;amp;quot;;name$&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    WindowWidth &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;400&lt;/span&gt;
    WindowHeight &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;300&lt;/span&gt;
    UpperLeftX &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayWidth &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; WindowWidth&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    UpperLeftY &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayHeight &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; WindowHeight&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    Statictext #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;stx1&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;What is your name?&amp;quot;&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;34&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;70&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;
    Textbox #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tbx1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    Button #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;default&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot; OK &amp;quot;&lt;/span&gt;, GetName, UL, &lt;span class=&quot;nu0&quot;&gt;320&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;
    Open &lt;span class=&quot;st0&quot;&gt;&amp;quot;Retrieving Textbox Contents&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; Dialog &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose XbyTrap&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
Wait
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; XbyTrap handle$
    Close #handle$
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; GetName handle$
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tbx1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? name$&amp;quot;&lt;/span&gt;
    Notice &lt;span class=&quot;st0&quot;&gt;&amp;quot;Hello, &amp;quot;&lt;/span&gt;;name$
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x-Retrieving Information from Textboxes with SendMessageA-A Multiline Textbox&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;A Multiline Textbox&lt;/h3&gt;
&lt;br /&gt;
There are times when a &lt;a href=&quot;http://lbpe.wikispaces.com/Stylebits+-+Textboxes&quot;&gt;multiline, word wrapping textbox&lt;/a&gt; may be preferred over the native Liberty BASIC texteditor.  See also &lt;a href=&quot;http://lbpe.wikispaces.com/Stylebits+-+Dialog+Windows&quot;&gt;An Improved Stylebits Textbox.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
There may also be a need to&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Get the number of lines in the textbox&lt;/li&gt;&lt;li&gt;Get the number of characters in each line of text&lt;/li&gt;&lt;li&gt;Get each separate line of text&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;
These functions are possible with an API call to &lt;tt&gt;#user32, &amp;quot;SendMessageA&amp;quot;&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x-Retrieving Information from Textboxes with SendMessageA-CallDLL #user32, &amp;quot;SendMessageA&amp;quot;&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;CallDLL #user32, &amp;quot;SendMessageA&amp;quot;&lt;/h3&gt;
&lt;br /&gt;
The SendMessageA function sends a specified messsage to a window or a control.  The arguments to be passed include&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;handle The handle of the window or control ULONG&lt;/li&gt;&lt;li&gt;Msg The specific message LONG&lt;/li&gt;&lt;li&gt;wParam additional information about the message LONG&lt;/li&gt;&lt;li&gt;lParam additional information about the message LONG&lt;/li&gt;&lt;/ul&gt;When the message is received, the return value specifies the result of the message processing.&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;result LONG&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Visit the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/default.aspx&quot; rel=&quot;nofollow&quot;&gt;MSDN Library&lt;/a&gt; for more information about &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/ms644950.aspx&quot; rel=&quot;nofollow&quot;&gt;SendMessage.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;x-Retrieving Information from Textboxes with SendMessageA-Get the Number of Lines in the Textbox&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;Get the Number of Lines in the Textbox&lt;/h3&gt;
&lt;br /&gt;
The Windows constant &lt;tt&gt;_EM_GETLINECOUNT&lt;/tt&gt; is the message used to retrieve the number of lines from a textbox.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;        hText as Ulong, _ &#039; handle of the textbox&amp;lt;br/&amp;gt;        _EM_GETLINECOUNT as Long, _ &#039; message to be passed&amp;lt;br/&amp;gt;        0 as Long, _ &#039; no further information to be passed&amp;lt;br/&amp;gt;        0 as Long, _ &#039; no further information to be passed&amp;lt;br/&amp;gt;        result as Long &#039; Windows returns the number of lines&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;, _
        hText &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039; handle of the textbox&lt;/span&gt;
        _EM_GETLINECOUNT &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039; message to be passed&lt;/span&gt;
        &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039; no further information to be passed&lt;/span&gt;
        &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039; no further information to be passed&lt;/span&gt;
        result &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039; Windows returns the number of lines&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;Here is a demo to get the number of lines in a textbox.  The mainwindow is kept visible for the printing of returned information.  You may need to reposition your GUI window to see this information.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;&#039; Define a textbox&amp;lt;br/&amp;gt;    Textbox #main.tb, 10, 20, 150, 68&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Stylebits for word wrapping and vertical scrolling&amp;lt;br/&amp;gt;    Stylebits #main.tb, _WS_VSCROLL OR _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Define text&amp;lt;br/&amp;gt;    demoText$ = &amp;amp;quot;All Gaul is divided into three parts, one of &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;which the Belgae inhabit, the Aquitani another, those who &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;in their own language are called Celts, in our Gauls, the third. &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;All these differ from each other in language, customs, and laws.&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Lines of Multiline Textbox&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose XbyTrap&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Times_New_Roman 10 bold&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Print the text in the textbox&amp;lt;br/&amp;gt;    #main.tb demoText$&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Get the handle of the textbox&amp;lt;br/&amp;gt;    hText=hWnd(#main.tb)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Pass the required arguments to SendMessageA API&amp;lt;br/&amp;gt;    nLines = ReturnedMessage(hText, _EM_GETLINECOUNT, 0, 0)&amp;lt;br/&amp;gt;    Print &amp;amp;quot;There are &amp;amp;quot;;nLines;&amp;amp;quot; lines in this textbox.&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Program ends here&amp;lt;br/&amp;gt;Sub XbyTrap handle$&amp;lt;br/&amp;gt;    Close #handle$&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; SendMessageA Function&amp;lt;br/&amp;gt;Function ReturnedMessage(handle, Msg, wParam, lParam)&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;        handle as Ulong, _&amp;lt;br/&amp;gt;        Msg as Long, _&amp;lt;br/&amp;gt;        wParam as Long, _&amp;lt;br/&amp;gt;        lParam as Long, _&amp;lt;br/&amp;gt;        ReturnedMessage as Long&amp;lt;br/&amp;gt;End Function&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Define a textbox&lt;/span&gt;
    Textbox #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;68&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Stylebits for word wrapping and vertical scrolling&lt;/span&gt;
    Stylebits #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;, _WS_VSCROLL &lt;span class=&quot;kw1&quot;&gt;OR&lt;/span&gt; _ES_MULTILINE, _ES_AUTOHSCROLL, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Define text&lt;/span&gt;
    demoText$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;All Gaul is divided into three parts, one of &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;which the Belgae inhabit, the Aquitani another, those who &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;in their own language are called Celts, in our Gauls, the third. &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;All these differ from each other in language, customs, and laws.&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Open &lt;span class=&quot;st0&quot;&gt;&amp;quot;Lines of Multiline Textbox&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose XbyTrap&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 10 bold&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Print the text in the textbox&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt; demoText$
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Get the handle of the textbox&lt;/span&gt;
    hText&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;hWnd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;#main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Pass the required arguments to SendMessageA API&lt;/span&gt;
    nLines &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; ReturnedMessage&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hText, _EM_GETLINECOUNT, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    Print &lt;span class=&quot;st0&quot;&gt;&amp;quot;There are &amp;quot;&lt;/span&gt;;nLines;&lt;span class=&quot;st0&quot;&gt;&amp;quot; lines in this textbox.&amp;quot;&lt;/span&gt;
&amp;nbsp;
Wait
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Program ends here&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; XbyTrap handle$
    Close #handle$
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; SendMessageA Function&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; ReturnedMessage&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;handle, Msg, wParam, lParam&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;, _
        handle &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _
        Msg &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        wParam &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        lParam &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        ReturnedMessage &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;x-Retrieving Information from Textboxes with SendMessageA-Get the Number of Characters in Each Line of Text&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;Get the Number of Characters in Each Line of Text&lt;/h3&gt;
&lt;br /&gt;
&lt;tt&gt;SendMessageA&lt;/tt&gt; will not return the actual text string.  Instead, it returns the number of characters in that string.  This next demo is the same as the previous demo, with a function added to get the number of characters at the end of each line.  It is important to recognize that the function does not return the number of characters in that line, but the number of characters from the &lt;em&gt;beginning of the text&lt;/em&gt; to the &lt;em&gt;end of that line&lt;/em&gt;.  Again using the API call &lt;tt&gt;SendMessageA&lt;/tt&gt;, the handle of the textbox is passed as well as the message &lt;tt&gt;_EM_LINEINDEX&lt;/tt&gt;.  &lt;tt&gt;SendMessageA&lt;/tt&gt; also needs to know which line is being questioned.  The first available extra information argument, &lt;tt&gt;wParam&lt;/tt&gt;, passes the line number to be queried.  There is no additional information needed, so the second informational argument, &lt;tt&gt;lParam&lt;/tt&gt;, remains 0.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;        hText as Ulong, _ &#039; handle of the textbox&amp;lt;br/&amp;gt;        _EM_LINEINDEX as Long, _ &#039; message to be passed&amp;lt;br/&amp;gt;        lineNumber as Long, _ &#039; the queried line number&amp;lt;br/&amp;gt;        0 as Long, _ &#039; no further information to be passed&amp;lt;br/&amp;gt;        result as Long &#039; Windows returns the number of lines&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;, _
        hText &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039; handle of the textbox&lt;/span&gt;
        _EM_LINEINDEX &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039; message to be passed&lt;/span&gt;
        lineNumber &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039; the queried line number&lt;/span&gt;
        &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039; no further information to be passed&lt;/span&gt;
        result &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039; Windows returns the number of lines&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;Since the last line is treated a little differently, the loop must terminate at the next to the last line &lt;tt&gt;For i = 1 to nLines - 1&lt;/tt&gt;.  The code for the last line immediately follows the loop.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;&#039; Define a textbox&amp;lt;br/&amp;gt;    Textbox #main.tb, 10, 20, 150, 68&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Stylebits for word wrapping and vertical scrolling&amp;lt;br/&amp;gt;    Stylebits #main.tb, _WS_VSCROLL OR _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Define text&amp;lt;br/&amp;gt;    demoText$ = &amp;amp;quot;All Gaul is divided into three parts, one of &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;which the Belgae inhabit, the Aquitani another, those who &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;in their own language are called Celts, in our Gauls, the third. &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;All these differ from each other in language, customs, and laws.&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Lines of Multiline Textbox&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose XbyTrap&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Times_New_Roman 10 bold&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Print the text in the textbox&amp;lt;br/&amp;gt;    #main.tb demoText$&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Get the handle of the textbox&amp;lt;br/&amp;gt;    hText=hWnd(#main.tb)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Pass the required arguments to SendMessageA API&amp;lt;br/&amp;gt;    nLines = ReturnedMessage(hText, _EM_GETLINECOUNT, 0, 0)&amp;lt;br/&amp;gt;    Print &amp;amp;quot;There are &amp;amp;quot;;nLines;&amp;amp;quot; lines in this textbox.&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Get the total number of characters at the end of each line&amp;lt;br/&amp;gt;    For i = 1 to nLines - 1&amp;lt;br/&amp;gt;        nCharacters = ReturnedMessage(hText, _EM_LINEINDEX, i, 0)&amp;lt;br/&amp;gt;        Print &amp;amp;quot;Line #&amp;amp;quot;;i;&amp;amp;quot;: &amp;amp;quot;;nCharacters;&amp;amp;quot; Characters&amp;amp;quot;&amp;lt;br/&amp;gt;    Next i&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Program ends here&amp;lt;br/&amp;gt;Sub XbyTrap handle$&amp;lt;br/&amp;gt;    Close #handle$&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; SendMessageA Function&amp;lt;br/&amp;gt;Function ReturnedMessage(handle, Msg, wParam, lParam)&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;        handle as Ulong, _&amp;lt;br/&amp;gt;        Msg as Long, _&amp;lt;br/&amp;gt;        wParam as Long, _&amp;lt;br/&amp;gt;        lParam as Long, _&amp;lt;br/&amp;gt;        ReturnedMessage as Long&amp;lt;br/&amp;gt;End Function&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Define a textbox&lt;/span&gt;
    Textbox #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;68&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Stylebits for word wrapping and vertical scrolling&lt;/span&gt;
    Stylebits #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;, _WS_VSCROLL &lt;span class=&quot;kw1&quot;&gt;OR&lt;/span&gt; _ES_MULTILINE, _ES_AUTOHSCROLL, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Define text&lt;/span&gt;
    demoText$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;All Gaul is divided into three parts, one of &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;which the Belgae inhabit, the Aquitani another, those who &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;in their own language are called Celts, in our Gauls, the third. &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;All these differ from each other in language, customs, and laws.&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Open &lt;span class=&quot;st0&quot;&gt;&amp;quot;Lines of Multiline Textbox&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose XbyTrap&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 10 bold&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Print the text in the textbox&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt; demoText$
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Get the handle of the textbox&lt;/span&gt;
    hText&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;hWnd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;#main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Pass the required arguments to SendMessageA API&lt;/span&gt;
    nLines &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; ReturnedMessage&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hText, _EM_GETLINECOUNT, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    Print &lt;span class=&quot;st0&quot;&gt;&amp;quot;There are &amp;quot;&lt;/span&gt;;nLines;&lt;span class=&quot;st0&quot;&gt;&amp;quot; lines in this textbox.&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Get the total number of characters at the end of each line&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; nLines &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
        nCharacters &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; ReturnedMessage&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hText, _EM_LINEINDEX, i, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        Print &lt;span class=&quot;st0&quot;&gt;&amp;quot;Line #&amp;quot;&lt;/span&gt;;i;&lt;span class=&quot;st0&quot;&gt;&amp;quot;: &amp;quot;&lt;/span&gt;;nCharacters;&lt;span class=&quot;st0&quot;&gt;&amp;quot; Characters&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i
&amp;nbsp;
Wait
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Program ends here&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; XbyTrap handle$
    Close #handle$
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; SendMessageA Function&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; ReturnedMessage&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;handle, Msg, wParam, lParam&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;, _
        handle &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _
        Msg &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        wParam &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        lParam &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        ReturnedMessage &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;How will knowing what the total number of characters reveal the actual number of characters in each line?  By keeping track of how many characters were used in preceding lines, the number of characters already assigned is known.  Subtract that number from the number of characters up to and including the selected line. The difference is the number of characters in just the selected line.  Start the position, &lt;tt&gt;startPos&lt;/tt&gt;, as 1.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;&#039; Define a textbox&amp;lt;br/&amp;gt;    Textbox #main.tb, 10, 20, 150, 68&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Stylebits for word wrapping and vertical scrolling&amp;lt;br/&amp;gt;    Stylebits #main.tb, _WS_VSCROLL OR _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Define text&amp;lt;br/&amp;gt;    demoText$ = &amp;amp;quot;All Gaul is divided into three parts, one of &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;which the Belgae inhabit, the Aquitani another, those who &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;in their own language are called Celts, in our Gauls, the third. &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;All these differ from each other in language, customs, and laws.&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Lines of Multiline Textbox&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main, &amp;amp;quot;Trapclose XbyTrap&amp;amp;quot;&amp;lt;br/&amp;gt;    #main, &amp;amp;quot;Font Times_New_Roman 10 bold&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Print the text in the textbox&amp;lt;br/&amp;gt;    #main.tb demoText$&amp;lt;br/&amp;gt;    textLength = Len(demoText$)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Get the handle of the textbox&amp;lt;br/&amp;gt;    hText=hWnd(#main.tb)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Pass the required arguments to SendMessageA API&amp;lt;br/&amp;gt;    nLines = ReturnedMessage(hText, _EM_GETLINECOUNT, 0, 0)&amp;lt;br/&amp;gt;    Print &amp;amp;quot;There are &amp;amp;quot;;nLines;&amp;amp;quot; lines in this textbox&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; The starting position is 1&amp;lt;br/&amp;gt;    startPos = 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    For i = 1 to nLines - 1&amp;lt;br/&amp;gt;&#039; Get the total number of characters in each line&amp;lt;br/&amp;gt;        nCharacters = ReturnedMessage(hText, _EM_LINEINDEX, i, 0)&amp;lt;br/&amp;gt;&#039; The characters in that line start with startPos and continue through to nCharacters&amp;lt;br/&amp;gt;        Print &amp;amp;quot;Line &amp;amp;quot;;i;&amp;amp;quot;: Characters &amp;amp;quot;;startPos;&amp;amp;quot; - &amp;amp;quot;;nCharacters&amp;lt;br/&amp;gt;&#039; startPos moves up to the nCharacters pos for the next line&amp;lt;br/&amp;gt;        startPos = nCharacters + 1&amp;lt;br/&amp;gt;    Next i&amp;lt;br/&amp;gt;&#039; Get the number of characters in the last line by subtracting the nCharacters&amp;lt;br/&amp;gt;&#039; found thus far from the Length of the entire text&amp;lt;br/&amp;gt;    nCharacters = textLength - nCharacters&amp;lt;br/&amp;gt;    Print &amp;amp;quot;Line &amp;amp;quot;;i;&amp;amp;quot;: Characters &amp;amp;quot;;startPos;&amp;amp;quot; - &amp;amp;quot;;textLength&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Wait for button to be pushed&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Program ends here&amp;lt;br/&amp;gt;Sub XbyTrap handle$&amp;lt;br/&amp;gt;    Close #handle$&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; SendMessageA Function&amp;lt;br/&amp;gt;Function ReturnedMessage(handle, Msg, wParam, lParam)&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;        handle as Ulong, _&amp;lt;br/&amp;gt;        Msg as Long, _&amp;lt;br/&amp;gt;        wParam as Long, _&amp;lt;br/&amp;gt;        lParam as Long, _&amp;lt;br/&amp;gt;        ReturnedMessage as Long&amp;lt;br/&amp;gt;End Function&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Define a textbox&lt;/span&gt;
    Textbox #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;68&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Stylebits for word wrapping and vertical scrolling&lt;/span&gt;
    Stylebits #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;, _WS_VSCROLL &lt;span class=&quot;kw1&quot;&gt;OR&lt;/span&gt; _ES_MULTILINE, _ES_AUTOHSCROLL, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Define text&lt;/span&gt;
    demoText$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;All Gaul is divided into three parts, one of &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;which the Belgae inhabit, the Aquitani another, those who &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;in their own language are called Celts, in our Gauls, the third. &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;All these differ from each other in language, customs, and laws.&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Open &lt;span class=&quot;st0&quot;&gt;&amp;quot;Lines of Multiline Textbox&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #main
    #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose XbyTrap&amp;quot;&lt;/span&gt;
    #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 10 bold&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Print the text in the textbox&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt; demoText$
    textLength &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; Len&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;demoText$&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Get the handle of the textbox&lt;/span&gt;
    hText&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;hWnd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;#main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Pass the required arguments to SendMessageA API&lt;/span&gt;
    nLines &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; ReturnedMessage&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hText, _EM_GETLINECOUNT, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    Print &lt;span class=&quot;st0&quot;&gt;&amp;quot;There are &amp;quot;&lt;/span&gt;;nLines;&lt;span class=&quot;st0&quot;&gt;&amp;quot; lines in this textbox&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; The starting position is 1&lt;/span&gt;
    startPos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; nLines &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; Get the total number of characters in each line&lt;/span&gt;
        nCharacters &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; ReturnedMessage&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hText, _EM_LINEINDEX, i, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; The characters in that line start with startPos and continue through to nCharacters&lt;/span&gt;
        Print &lt;span class=&quot;st0&quot;&gt;&amp;quot;Line &amp;quot;&lt;/span&gt;;i;&lt;span class=&quot;st0&quot;&gt;&amp;quot;: Characters &amp;quot;&lt;/span&gt;;startPos;&lt;span class=&quot;st0&quot;&gt;&amp;quot; - &amp;quot;&lt;/span&gt;;nCharacters
&lt;span class=&quot;co1&quot;&gt;&#039; startPos moves up to the nCharacters pos for the next line&lt;/span&gt;
        startPos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; nCharacters &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i
&lt;span class=&quot;co1&quot;&gt;&#039; Get the number of characters in the last line by subtracting the nCharacters&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; found thus far from the Length of the entire text&lt;/span&gt;
    nCharacters &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; textLength &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; nCharacters
    Print &lt;span class=&quot;st0&quot;&gt;&amp;quot;Line &amp;quot;&lt;/span&gt;;i;&lt;span class=&quot;st0&quot;&gt;&amp;quot;: Characters &amp;quot;&lt;/span&gt;;startPos;&lt;span class=&quot;st0&quot;&gt;&amp;quot; - &amp;quot;&lt;/span&gt;;textLength
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Wait for button to be pushed&lt;/span&gt;
    Wait
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Program ends here&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; XbyTrap handle$
    Close #handle$
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; SendMessageA Function&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; ReturnedMessage&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;handle, Msg, wParam, lParam&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;, _
        handle &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _
        Msg &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        wParam &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        lParam &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        ReturnedMessage &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;x-Retrieving Information from Textboxes with SendMessageA-Liberty BASIC&#039;s Mid$() Function&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;Liberty BASIC&#039;s Mid$() Function&lt;/h3&gt;
&lt;br /&gt;
Now that the starting and ending character position number is known, the Liberty BASIC Mid$() function can be used to extract that one line.  The Mid$() function has 3 elements&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;The whole text to be parsed (demoText$)&lt;/li&gt;&lt;li&gt;The starting position (startPos)&lt;/li&gt;&lt;li&gt;The number of characters to be extracted from the starting position to the right (nCharacters - startPos)&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;
A simple demo of the Liberty BASIC Mid$() function -&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;    txt$ = &amp;amp;quot;trouble&amp;amp;quot;&amp;lt;br/&amp;gt;    m$ = Mid$(txt$, 4, 3)&amp;lt;br/&amp;gt;    Print m$&amp;lt;br/&amp;gt;    End&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;    txt$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;trouble&amp;quot;&lt;/span&gt;
    m$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw7&quot;&gt;Mid$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;txt$, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    Print m$
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;Executing this code prints &lt;tt&gt;ubl&lt;/tt&gt;, where &lt;tt&gt;u&lt;/tt&gt; is the character in the fourth position of the string &lt;tt&gt;trouble&lt;/tt&gt;, and &lt;tt&gt;ubl&lt;/tt&gt; are the three characters in sequence beginning in this fourth position.&lt;br /&gt;
&lt;br /&gt;
In this textbox demo, &lt;tt&gt;startPos&lt;/tt&gt; becomes the start position and &lt;tt&gt;nCharacters - startPos&lt;/tt&gt; becomes the sequence range of characters.  Here is the code again, this time extracting and printing each line of text.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;vbnet&amp;quot;&amp;gt;&#039; Define a textbox&amp;lt;br/&amp;gt;    Textbox #main.tb, 10, 20, 150, 68&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Stylebits for word wrapping and vertical scrolling&amp;lt;br/&amp;gt;    Stylebits #main.tb, _WS_VSCROLL OR _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Define text&amp;lt;br/&amp;gt;    demoText$ = &amp;amp;quot;All Gaul is divided into three parts, one of &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;which the Belgae inhabit, the Aquitani another, those who &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;in their own language are called Celts, in our Gauls, the third. &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;All these differ from each other in language, customs, and laws.&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Lines of Multiline Textbox&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose XbyTrap&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Times_New_Roman 10 bold&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Print the text in the textbox&amp;lt;br/&amp;gt;    #main.tb demoText$&amp;lt;br/&amp;gt;    textLength = Len(demoText$)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Get the handle of the textbox&amp;lt;br/&amp;gt;    hText=hWnd(#main.tb)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Pass the required arguments to SendMessageA API&amp;lt;br/&amp;gt;    nLines = ReturnedMessage(hText, _EM_GETLINECOUNT, 0, 0)&amp;lt;br/&amp;gt;    Print &amp;amp;quot;There are &amp;amp;quot;;nLines;&amp;amp;quot; lines in this textbox&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; The starting position is 1&amp;lt;br/&amp;gt;    startPos = 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    For i = 1 to nLines - 1&amp;lt;br/&amp;gt;&#039; Get the total number of characters in each line&amp;lt;br/&amp;gt;        nCharacters = ReturnedMessage(hText, _EM_LINEINDEX, i, 0)&amp;lt;br/&amp;gt;&#039; Print that line of text using the Mid$() function&amp;lt;br/&amp;gt;        Print Mid$(demoText$, startPos, nCharacters - startPos)&amp;lt;br/&amp;gt;&#039; startPos moves up to the nCharacters pos for the next line&amp;lt;br/&amp;gt;        startPos = nCharacters + 1&amp;lt;br/&amp;gt;    Next i&amp;lt;br/&amp;gt;&#039; Get the number of characters in the last line by subtracting the nCharacters&amp;lt;br/&amp;gt;&#039; found thus far from the Length of the entire text&amp;lt;br/&amp;gt;    nCharacters = textLength - nCharacters&amp;lt;br/&amp;gt;    Print Mid$(demoText$, startPos, nCharacters)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Wait for button to be pushed&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Program ends here&amp;lt;br/&amp;gt;Sub XbyTrap handle$&amp;lt;br/&amp;gt;    Close #handle$&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; SendMessageA Function&amp;lt;br/&amp;gt;Function ReturnedMessage(handle, Msg, wParam, lParam)&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;        handle as Ulong, _&amp;lt;br/&amp;gt;        Msg as Long, _&amp;lt;br/&amp;gt;        wParam as Long, _&amp;lt;br/&amp;gt;        lParam as Long, _&amp;lt;br/&amp;gt;        ReturnedMessage as Long&amp;lt;br/&amp;gt;End Function&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vbnet  {font-family:monospace;}
.vbnet .imp {font-weight: bold; color: red;}
.vbnet .kw1 {color: #0000FF; font-weight: bold;}
.vbnet .kw2 {color: #6a5acd;}
.vbnet .kw3 {color: #6a5acd; font-weight: bold;}
.vbnet .kw4 {color: #cd6a5a;}
.vbnet .kw5 {color: #cd6a5a; font-weight: bold;}
.vbnet .kw7 {color: #000066;}
.vbnet .co1 {color: #008000; font-style: italic;}
.vbnet .coMULTI {color: #008000; font-style: italic;}
.vbnet .es0 {color: #008080; font-weight: bold;}
.vbnet .br0 {color: #000000;}
.vbnet .sy0 {color: #000000;}
.vbnet .st0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .nu0 {color: #a52a2a; back-color: #fffacd;}
.vbnet .me1 {color: #000000;}
.vbnet span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vbnet&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Define a textbox&lt;/span&gt;
    Textbox #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;68&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Stylebits for word wrapping and vertical scrolling&lt;/span&gt;
    Stylebits #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;, _WS_VSCROLL &lt;span class=&quot;kw1&quot;&gt;OR&lt;/span&gt; _ES_MULTILINE, _ES_AUTOHSCROLL, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Define text&lt;/span&gt;
    demoText$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;All Gaul is divided into three parts, one of &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;which the Belgae inhabit, the Aquitani another, those who &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;in their own language are called Celts, in our Gauls, the third. &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;All these differ from each other in language, customs, and laws.&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Open &lt;span class=&quot;st0&quot;&gt;&amp;quot;Lines of Multiline Textbox&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose XbyTrap&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 10 bold&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Print the text in the textbox&lt;/span&gt;
    #main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt; demoText$
    textLength &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; Len&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;demoText$&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Get the handle of the textbox&lt;/span&gt;
    hText&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;hWnd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;#main&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;tb&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Pass the required arguments to SendMessageA API&lt;/span&gt;
    nLines &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; ReturnedMessage&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hText, _EM_GETLINECOUNT, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    Print &lt;span class=&quot;st0&quot;&gt;&amp;quot;There are &amp;quot;&lt;/span&gt;;nLines;&lt;span class=&quot;st0&quot;&gt;&amp;quot; lines in this textbox&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; The starting position is 1&lt;/span&gt;
    startPos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; nLines &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; Get the total number of characters in each line&lt;/span&gt;
        nCharacters &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; ReturnedMessage&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hText, _EM_LINEINDEX, i, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; Print that line of text using the Mid$() function&lt;/span&gt;
        Print &lt;span class=&quot;kw7&quot;&gt;Mid$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;demoText$, startPos, nCharacters &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; startPos&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; startPos moves up to the nCharacters pos for the next line&lt;/span&gt;
        startPos &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; nCharacters &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i
&lt;span class=&quot;co1&quot;&gt;&#039; Get the number of characters in the last line by subtracting the nCharacters&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; found thus far from the Length of the entire text&lt;/span&gt;
    nCharacters &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; textLength &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; nCharacters
    Print &lt;span class=&quot;kw7&quot;&gt;Mid$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;demoText$, startPos, nCharacters&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Wait for button to be pushed&lt;/span&gt;
    Wait
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Program ends here&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; XbyTrap handle$
    Close #handle$
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; SendMessageA Function&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; ReturnedMessage&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;handle, Msg, wParam, lParam&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;, _
        handle &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Ulong&lt;/span&gt;, _
        Msg &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        wParam &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        lParam &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;, _
        ReturnedMessage &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Long&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;You may never need to extract single lines of text in a multiline textbox, but at least you know you can.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
</description>
          </item>
    <item>
      <title>Stylebits - Buttons</title>
      <link>https://lbpe.wikispaces.com/Stylebits+-+Buttons</link>
      <dc:creator>StPendl</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/Stylebits+-+Buttons</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/Stylebits+-+Buttons</comments>
      <pubDate>Fri, 16 Aug 2013 08:54:29 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x--Reviewing the Stylebits Parameters&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;Reviewing the Stylebits Parameters&lt;/h3&gt;
&lt;br /&gt;
The four parameters of stylebits are AddBit, RemoveBit, AddExtendedBit, RemoveExtendedBit.  For a review of these four parameters, and an introduction to Stylebits in general, please view &lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Windows&quot;&gt;Stylebits - Windows&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x--Stylebits and a Default Button&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Stylebits and a Default Button&lt;/h3&gt;
A default button is the button that will be triggered with the Enter key, as long as the dialog window has focus.  Without stylebits, a default button is only possible in a Dialog Window and then only if the button has the extension &lt;em&gt;default&lt;/em&gt;.  Brent Thorn posted code using Stylebits _BS_DEFPUSHBUTTON to assign a default button in a regular window with any extension.  Thanks, Brent!  Be sure to give focus to the dialog window by setting focus to one of the (non-button) controls prior to the activation of the default button.  A simple Setfocus to a textbox (any textbox) will accomplish that.  Here is a modification of Brent&#039;s code.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;&#039;Using a Default Button in a Regular Window&amp;lt;br/&amp;gt;&#039;Thanks to Brent Thorn&amp;lt;br/&amp;gt;&#039; http://libertybasic.conforums.com/index.cgi?board=novice&amp;amp;amp;action=display&amp;amp;amp;num=1134254812&amp;lt;br/&amp;gt;&#039;Modifications by Janet = Menu and Setfocus to #main.tbx1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    WindowWidth = 300&amp;lt;br/&amp;gt;    WindowHeight = 350&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Menu #main, &amp;amp;quot;&amp;amp;amp;Options&amp;amp;quot;, &amp;amp;quot;E&amp;amp;amp;xit&amp;amp;quot;, EndDemoMenu&amp;lt;br/&amp;gt;    Textbox #main.tbx1, 150, 50, 120, 30&amp;lt;br/&amp;gt;    Textbox #main.tbx2, 150, 100, 120, 30&amp;lt;br/&amp;gt;    Textbox #main.tbx3, 150, 150, 120, 30&amp;lt;br/&amp;gt;    Textbox #main.tbx4, 150, 200, 120, 30&amp;lt;br/&amp;gt;    Stylebits #main.default, _BS_DEFPUSHBUTTON, 0, 0, 0&amp;lt;br/&amp;gt;    Button #main.default, &amp;amp;quot;&amp;amp;quot;, DefaultButton, UL, -100, -100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Default Button in a Regular Window&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.textbox &amp;amp;quot;!Setfocus&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub DefaultButton handle$&amp;lt;br/&amp;gt;        #main.tbx1 &amp;amp;quot;!Contents? text1$&amp;amp;quot;&amp;lt;br/&amp;gt;        #main.tbx2 &amp;amp;quot;!Contents? text2$&amp;amp;quot;&amp;lt;br/&amp;gt;        #main.tbx3 &amp;amp;quot;!Contents? text3$&amp;amp;quot;&amp;lt;br/&amp;gt;        #main.tbx4 &amp;amp;quot;!Contents? text4$&amp;amp;quot;&amp;lt;br/&amp;gt;        Notice &amp;amp;quot;The textboxes read&amp;amp;quot;;Chr$(13);Chr$(13) + _&amp;lt;br/&amp;gt;            text1$;Chr$(13);text2$;Chr$(13);text3$;Chr$(13);text4$&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemoMenu&amp;lt;br/&amp;gt;        Call EndDemo &amp;amp;quot;#main&amp;amp;quot;&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemo handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;    End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Using a Default Button in a Regular Window&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;Thanks to Brent Thorn&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; http://libertybasic.conforums.com/index.cgi?board=novice&amp;amp;action=display&amp;amp;num=1134254812&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;Modifications by Janet = Menu and Setfocus to #main.tbx1&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;300&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;350&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;UpperLeftX&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;DisplayWidth&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;UpperLeftY&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;DisplayHeight&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Menu&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;amp;Options&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;E&amp;amp;xit&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; EndDemoMenu
    &lt;span class=&quot;kw1&quot;&gt;Textbox&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.tbx1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Textbox&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.tbx2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Textbox&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.tbx3&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Textbox&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.tbx4&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.default&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _BS_DEFPUSHBUTTON&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.default&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; DefaultButton&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Default Button in a Regular Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.&lt;span class=&quot;kw1&quot;&gt;textbox&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Setfocus&amp;quot;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; DefaultButton handle$
        &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.tbx1 &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? text1$&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.tbx2 &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? text2$&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.tbx3 &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? text3$&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main.tbx4 &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? text4$&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;Notice&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;The textboxes read&amp;quot;&lt;/span&gt;;&lt;span class=&quot;kw2&quot;&gt;Chr$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;span class=&quot;kw2&quot;&gt;Chr$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
            text1$;&lt;span class=&quot;kw2&quot;&gt;Chr$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;text2$;&lt;span class=&quot;kw2&quot;&gt;Chr$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;text3$;&lt;span class=&quot;kw2&quot;&gt;Chr$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;text4$
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemoMenu
        &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; EndDemo &lt;span class=&quot;st0&quot;&gt;&amp;quot;#main&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
        &lt;span class=&quot;kw1&quot;&gt;Close&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;main
        &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:21:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@StylebitsButtonLabels&amp;quot; title=&amp;quot;Anchor: StylebitsButtonLabels&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;StylebitsButtonLabels&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:21 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x--Stylebits and Button Labels&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;Stylebits and Button Labels&lt;/h3&gt;
&lt;br /&gt;
Many of the stylebits statictext border effects can be obtained with buttons as well.  Use the same windows style _WS_ prefixes seen in changing window and other control edges.  You can even add a titlebar to a button.  These stylebits give a bit of variety to the button appearance and may enhance the overall 3D effect.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;_WS_BORDER, 0, 0, 0&amp;lt;br/&amp;gt;_WS_DLGFRAME&amp;lt;br/&amp;gt;_WS_CAPTION, _WS_MAXIMIZEBOX&amp;lt;br/&amp;gt;0, 0, _WS_EX_CLIENTEDGE, 0&amp;lt;br/&amp;gt;0, 0, _WS_EX_CLIENTEDGE or _WS_EX_DLGMODALFRAME, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;_WS_BORDER&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
_WS_DLGFRAME
_WS_CAPTION&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_MAXIMIZEBOX
&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_EX_CLIENTEDGE&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_EX_CLIENTEDGE &lt;span class=&quot;kw1&quot;&gt;or&lt;/span&gt; _WS_EX_DLGMODALFRAME&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;This demo shows some of the border effects that can be achieved with stylebits&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;    WindowWidth = 600&amp;lt;br/&amp;gt;    WindowHeight = 560&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth-WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight-WindowHeight)/3)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Button #demo.bttn1, &amp;amp;quot;One&amp;amp;quot;, Click, UL, 20, 60, 80, 40&amp;lt;br/&amp;gt;    bttnText1$ = &amp;amp;quot;0, 0, 0, 0 &#039;No Stylebits&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #demo, bttnText1$, 180, 70, 400, 30&amp;lt;br/&amp;gt;    Button #demo.bttn2, &amp;amp;quot;Two&amp;amp;quot;, Click, UL, 20, 120, 80, 40&amp;lt;br/&amp;gt;    bttnText2$ = &amp;amp;quot;_WS_BORDER, 0, 0, 0&amp;amp;quot;&amp;lt;br/&amp;gt;    Stylebits #demo.bttn2, _WS_BORDER, 0, 0, 0&amp;lt;br/&amp;gt;    Statictext #demo, bttnText2$, 180, 130, 400, 30&amp;lt;br/&amp;gt;    Button #demo.bttn3, &amp;amp;quot;Three&amp;amp;quot;, Click, UL, 20, 180, 80, 40&amp;lt;br/&amp;gt;    bttnText3$ = &amp;amp;quot;_WS_DLGFRAME, 0, 0, 0&amp;amp;quot;&amp;lt;br/&amp;gt;    Stylebits #demo.bttn3, _WS_DLGFRAME, 0, 0, 0&amp;lt;br/&amp;gt;    Statictext #demo, bttnText3$, 180, 190, 400, 30&amp;lt;br/&amp;gt;    Button #demo.bttn4, &amp;amp;quot;Four&amp;amp;quot;, Click, UL, 20, 240, 80, 100&amp;lt;br/&amp;gt;    bttnText4$ = &amp;amp;quot;_WS_CAPTION, _WS_MAXIMIZEBOX, 0, 0&amp;amp;quot;;Chr$(13) + _&amp;lt;br/&amp;gt;        &amp;amp;quot;Remove maximize ability or double clicking caption will cause &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;button to expand to size of window.&amp;amp;quot;&amp;lt;br/&amp;gt;    Stylebits #demo.bttn4, _WS_CAPTION, _WS_MAXIMIZEBOX, 0, 0&amp;lt;br/&amp;gt;    Statictext #demo, bttnText4$, 180, 250, 400, 90&amp;lt;br/&amp;gt;    Button #demo.bttn5, &amp;amp;quot;Five&amp;amp;quot;, Click, UL, 20, 360, 80, 40&amp;lt;br/&amp;gt;    bttnText5$ = &amp;amp;quot;0, 0, _WS_EX_CLIENTEDGE, 0&amp;amp;quot;&amp;lt;br/&amp;gt;    Stylebits #demo.bttn5, 0, 0, _WS_EX_CLIENTEDGE, 0&amp;lt;br/&amp;gt;    Statictext #demo, bttnText5$, 180, 370, 400, 30&amp;lt;br/&amp;gt;    Button #demo.bttn6, &amp;amp;quot;Six&amp;amp;quot;, Click, UL, 20, 420, 80, 40&amp;lt;br/&amp;gt;    bttnText6$ = &amp;amp;quot;0, 0, _WS_EX_CLIENTEDGE or _WS_EX_DLGMODALFRAME, 0&amp;amp;quot;&amp;lt;br/&amp;gt;    Stylebits #demo.bttn6, 0, 0, _WS_EX_CLIENTEDGE or _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Statictext #demo, bttnText6$, 180, 420, 400, 60&amp;lt;br/&amp;gt;    msg$ = &amp;amp;quot;These are only a few examples of button borders available with &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;stylebits.  Experiment to find others.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #demo, msg$, 20, 480, 560, 60&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Button Effects with Stylebits&amp;amp;quot; for Window as #demo&amp;lt;br/&amp;gt;    #demo &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #demo &amp;amp;quot;Font Times_New_Roman 14 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub EndDemo handle$&amp;lt;br/&amp;gt;    Close #demo&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub Click handle$&amp;lt;br/&amp;gt;    nButton$ = Right$(handle$, 1)&amp;lt;br/&amp;gt;    Notice &amp;amp;quot;Button #&amp;amp;quot;;nButton$;&amp;amp;quot; Clicked&amp;amp;quot;&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;    &lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;600&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;UpperLeftX&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayWidth&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;UpperLeftY&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayHeight&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Nomainwin&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;One&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    bttnText1$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;0, 0, 0, 0 &#039;No Stylebits&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; bttnText1$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;70&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Two&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    bttnText2$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;_WS_BORDER, 0, 0, 0&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_BORDER&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; bttnText2$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;130&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn3&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Three&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    bttnText3$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;_WS_DLGFRAME, 0, 0, 0&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn3&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_DLGFRAME&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; bttnText3$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;190&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn4&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Four&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;240&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;
    bttnText4$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;_WS_CAPTION, _WS_MAXIMIZEBOX, 0, 0&amp;quot;&lt;/span&gt;;&lt;span class=&quot;kw2&quot;&gt;Chr$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;Remove maximize ability or double clicking caption will cause &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;button to expand to size of window.&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn4&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_CAPTION&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_MAXIMIZEBOX&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; bttnText4$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;250&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;90&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn5&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Five&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;360&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    bttnText5$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;0, 0, _WS_EX_CLIENTEDGE, 0&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn5&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_EX_CLIENTEDGE&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; bttnText5$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;370&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn6&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Six&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;420&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    bttnText6$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;0, 0, _WS_EX_CLIENTEDGE or _WS_EX_DLGMODALFRAME, 0&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn6&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_EX_CLIENTEDGE &lt;span class=&quot;kw1&quot;&gt;or&lt;/span&gt; _WS_EX_DLGMODALFRAME&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; bttnText6$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;420&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;
    msg$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;These are only a few examples of button borders available with &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;stylebits.  Experiment to find others.&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; msg$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;480&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button Effects with Stylebits&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 14 Bold&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
    &lt;span class=&quot;kw1&quot;&gt;Close&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Click handle$
    nButton$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Right$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;handle$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Notice&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button #&amp;quot;&lt;/span&gt;;nButton$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; Clicked&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x--Stylebits and Tabbing&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;Stylebits and Tabbing&lt;/h3&gt;
&lt;br /&gt;
Pressing the TAB key can cycle focus from one control to the next.  The cycling order is the same order as that which the controls are created.  Sometimes it may be desirable to not include a control in the tabbed cycle.  The programmer may not want the QUIT button to be included in the TAB Cycle so that the user doesn&#039;t inadvertently exit a program prematurely.  Assigning the stylebit _WS_TABSTOP to the RemoveBit (second) stylebits parameter will keep that button from gaining focus in the TAB sequence.  The button does remain active and will receive focus when mouseclicked.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;    WindowWidth = 600&amp;lt;br/&amp;gt;    WindowHeight = 560&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth-WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight-WindowHeight)/3)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Button #demo.bttn1, &amp;amp;quot;Button 1&amp;amp;quot;, Click, UL, 100, 100, 120, 40&amp;lt;br/&amp;gt;    Stylebits #demo.bttn1, 0, 0, 0, 0&amp;lt;br/&amp;gt;    Button #demo.bttn2, &amp;amp;quot;Button 2&amp;amp;quot;, Click, UL, 100, 200, 120, 40&amp;lt;br/&amp;gt;    Stylebits #demo.bttn2, 0, 0, 0, 0&amp;lt;br/&amp;gt;    Button #demo.bttn3, &amp;amp;quot;Button 3&amp;amp;quot;, Click, UL, 320, 100, 120, 40&amp;lt;br/&amp;gt;    Stylebits #demo.bttn3, 0, 0, 0, 0&amp;lt;br/&amp;gt;    Button #demo.bttn4, &amp;amp;quot;Button 4&amp;amp;quot;, Click, UL, 320, 200, 120, 40&amp;lt;br/&amp;gt;    Stylebits #demo.bttn4, 0, 0, 0, 0&amp;lt;br/&amp;gt;    Button #demo.bttn5, &amp;amp;quot;Exit&amp;amp;quot;, endDemo, UL, 100, 300, 120, 40&amp;lt;br/&amp;gt;    Statictext #demo, &amp;amp;quot;0, _WS_TABSTOP, 0, 0&amp;amp;quot;, 40, 350, 200, 30&amp;lt;br/&amp;gt;    Stylebits #demo.bttn5, 0, _WS_TABSTOP, 0, 0&amp;lt;br/&amp;gt;    Textbox #demo.txtbx, 320, 300, 120, 40&amp;lt;br/&amp;gt;    Stylebits #demo.txtbx, 0, _WS_TABSTOP, 0, 0&amp;lt;br/&amp;gt;    Statictext #demo, &amp;amp;quot;0, _WS_TABSTOP, 0, 0&amp;amp;quot;, 320, 350, 200, 30&amp;lt;br/&amp;gt;    msg$ = &amp;amp;quot;Use the TAB key to maneuver from one button to the next.  &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;The button with focus has a darkened outline.  The removal of &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;_WS_TABSTOP stylebits prevents the EXIT button and the textbox &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;from being part of the tabbed cycle.  Note that one button must &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;receive focus before the TAB key can be recognized.&amp;amp;quot;&amp;lt;br/&amp;gt;    StaticText #demo.txt5, msg$, 20, 390, 560, 120&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Button Effects with Stylebits&amp;amp;quot; for Window as #demo&amp;lt;br/&amp;gt;    #demo &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #demo &amp;amp;quot;Font Times_New_Roman 14 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #demo.bttn4 &amp;amp;quot;!Setfocus&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub EndDemo handle$&amp;lt;br/&amp;gt;    Close #demo&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub Click handle$&amp;lt;br/&amp;gt;    nButton$ = Right$(handle$, 1)&amp;lt;br/&amp;gt;    Notice &amp;amp;quot;Button #&amp;amp;quot;;nButton$;&amp;amp;quot; Clicked&amp;amp;quot;&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;    &lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;600&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;UpperLeftX&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayWidth&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;UpperLeftY&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayHeight&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Nomainwin&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button 1&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button 2&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn3&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button 3&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;320&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn3&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn4&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button 4&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;320&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn4&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn5&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Exit&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; endDemo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;0, _WS_TABSTOP, 0, 0&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;350&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn5&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_TABSTOP&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Textbox&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.txtbx&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;320&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.txtbx&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_TABSTOP&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;0, _WS_TABSTOP, 0, 0&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;320&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;350&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;
    msg$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Use the TAB key to maneuver from one button to the next.  &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;The button with focus has a darkened outline.  The removal of &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;_WS_TABSTOP stylebits prevents the EXIT button and the textbox &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;from being part of the tabbed cycle.  Note that one button must &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;receive focus before the TAB key can be recognized.&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;StaticText&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.txt5&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; msg$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;390&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button Effects with Stylebits&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 14 Bold&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn4 &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Setfocus&amp;quot;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
    &lt;span class=&quot;kw1&quot;&gt;Close&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Click handle$
    nButton$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Right$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;handle$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Notice&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button #&amp;quot;&lt;/span&gt;;nButton$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; Clicked&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;x--Stylebits and Formatted Text Labels&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;Stylebits and Formatted Text Labels&lt;/h3&gt;
&lt;br /&gt;
The stylebits commands to format button text labels are similar to those _ES_  textbox and statictext formatting commands.  Button formatting style commands begin with _BS_.  The default style is text that remains on one line centered both vertically and horizontally.  With stylebits, you can left justify, right justify, center, place text at the top of the button and place text at the bottom of the button. The most useful of these stylebits is the _BS_MULTILINE which allows word wrapping and multiline button labels.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;_BS_LEFT&amp;lt;br/&amp;gt;_BS_CENTER &#039;The Default&amp;lt;br/&amp;gt;_BS_RIGHT&amp;lt;br/&amp;gt;_BS_TOP&amp;lt;br/&amp;gt;_BS_BOTTOM&amp;lt;br/&amp;gt;_BS_MULTLINE&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;_BS_LEFT
_BS_CENTER &lt;span class=&quot;co1&quot;&gt;&#039;The Default&lt;/span&gt;
_BS_RIGHT
_BS_TOP
_BS_BOTTOM
_BS_MULTLINE&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;This third demo demonstrates button text formatting with stylebits&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;    WindowWidth = 600&amp;lt;br/&amp;gt;    WindowHeight = 560&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth-WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight-WindowHeight)/3)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    Button #demo.bttn1, &amp;amp;quot;Default&amp;amp;quot;, Click, UL, 20, 80, 120, 80&amp;lt;br/&amp;gt;    Statictext #demo, &amp;amp;quot;0, 0, 0, 0&amp;amp;quot;, 44, 165, 260, 60&amp;lt;br/&amp;gt;    Button #demo.bttn2, &amp;amp;quot;Multiline Text on a Button&amp;amp;quot;, Click, UL, 20, 230, 120, 80&amp;lt;br/&amp;gt;    Stylebits #demo.bttn2, _BS_MULTILINE, 0, 0, 0&amp;lt;br/&amp;gt;    Statictext #demo, &amp;amp;quot;_BS_MULTILINE, 0, 0, 0&amp;amp;quot;, 20, 315, 260, 60&amp;lt;br/&amp;gt;    Button #demo.bttn3, &amp;amp;quot;Text@Bottom&amp;amp;quot;, Click, UL, 300, 80, 120, 80&amp;lt;br/&amp;gt;    Stylebits #demo.bttn3, _BS_BOTTOM, 0, 0, 0&amp;lt;br/&amp;gt;    Statictext #demo, &amp;amp;quot;_BS_BOTTOM, 0, 0, 0&amp;amp;quot;, 300, 165, 260, 260&amp;lt;br/&amp;gt;    Button #demo.bttn4, &amp;amp;quot;Text@Top&amp;amp;quot;, Click, UL, 300, 230, 120, 80&amp;lt;br/&amp;gt;    Stylebits #demo.bttn4, _BS_TOP, 0, 0, 0&amp;lt;br/&amp;gt;    Statictext #demo, &amp;amp;quot;_BS_TOP, 0, 0, 0&amp;amp;quot;, 300, 315, 260, 60&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    msg$ = &amp;amp;quot;See API Corner - Easy BMPButtons by Alyce Watson &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;in the Liberty BASIC Newsletter Issue #123 to learn how the &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;Stylebit _BS_BITMAP is used to create a more Windows &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;conforming look to your buttons. &amp;amp;quot;&amp;lt;br/&amp;gt;    StaticText #demo.txt5, msg$, 20, 370, 560, 120&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Button Formatting with Stylebits&amp;amp;quot; for Window as #demo&amp;lt;br/&amp;gt;    #demo &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #demo &amp;amp;quot;Font Times_New_Roman 14 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #demo.bttn4 &amp;amp;quot;!Setfocus&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub EndDemo handle$&amp;lt;br/&amp;gt;    Close #demo&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub Click handle$&amp;lt;br/&amp;gt;    nButton$ = Right$(handle$, 1)&amp;lt;br/&amp;gt;    Notice &amp;amp;quot;Button #&amp;amp;quot;;nButton$;&amp;amp;quot; Clicked&amp;amp;quot;&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;    &lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;600&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;UpperLeftX&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayWidth&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;UpperLeftY&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayHeight&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Nomainwin&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Default&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;0, 0, 0, 0&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;44&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;165&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;260&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Multiline Text on a Button&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;230&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _BS_MULTILINE&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;_BS_MULTILINE, 0, 0, 0&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;315&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;260&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn3&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Text@Bottom&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn3&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _BS_BOTTOM&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;_BS_BOTTOM, 0, 0, 0&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;165&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;260&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;260&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn4&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Text@Top&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;230&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn4&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _BS_TOP&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Statictext&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;_BS_TOP, 0, 0, 0&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;315&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;260&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;
&amp;nbsp;
    msg$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;See API Corner - Easy BMPButtons by Alyce Watson &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;in the Liberty BASIC Newsletter Issue #123 to learn how the &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebit _BS_BITMAP is used to create a more Windows &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;conforming look to your buttons. &amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;StaticText&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.txt5&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; msg$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;370&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;120&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button Formatting with Stylebits&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 14 Bold&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.bttn4 &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Setfocus&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
    &lt;span class=&quot;kw1&quot;&gt;Close&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Click handle$
    nButton$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Right$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;handle$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Notice&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button #&amp;quot;&lt;/span&gt;;nButton$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; Clicked&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;x--Stylebits and API Calls&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;Stylebits and API Calls&lt;/h3&gt;
&lt;br /&gt;
Stylebits allow buttons to display images, but only when accompanied by an API call to user32.dll (SendMessageA). For an indepth explanation of placing images on button controls, see &lt;a class=&quot;wiki_link&quot; href=&quot;/newsletter.2004&quot;&gt;API Corner - Easy BmpButtons (Liberty BASIC Newsletter, May, 2004)&lt;/a&gt; by Alyce Watson.  In this referenced article, Alyce also explains how using Stylebits with BmpButtons preserves the intended recessed look of the button when clicked, rather than the inverse color effect on the non-Stylebits native Liberty Basic BmpButton.  If you use the _BS_BITMAP stylebit, be sure to include the height and width of the bitmap as the height and width of the button.  Otherwise, the button size defaults to that of the null character of the chosen font.  As with statictext, you can combine _BS_BITMAP with border styles to achieve interesting effects.  Try making colorful buttons in your program without having to preload bitmap images.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;lb&amp;quot;&amp;gt;&#039; Demonstrates colorful buttons without first&amp;lt;br/&amp;gt;&#039; having to load bitmaps&amp;lt;br/&amp;gt;    WindowWidth = 600&amp;lt;br/&amp;gt;    WindowHeight = 560&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth-WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight-WindowHeight)/3)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Quick Draw&amp;amp;quot; for Graphics as #1&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Down&amp;amp;quot;&amp;lt;br/&amp;gt;    hBmp1 = solidButton()&amp;lt;br/&amp;gt;    hBmp2 = varigatedButton()&amp;lt;br/&amp;gt;    hBmp3 = stripedButton()&amp;lt;br/&amp;gt;    Close #1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Button #demo.b1, &amp;amp;quot;&amp;amp;quot;, Click, UL, 20, 20, 50, 50&amp;lt;br/&amp;gt;    Stylebits #demo.b1, _BS_BITMAP, 0, _WS_EX_CLIENTEDGE OR _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Button #demo.b2, &amp;amp;quot;&amp;amp;quot;, Click, UL, 20, 100, 50, 50&amp;lt;br/&amp;gt;    Stylebits #demo.b2, _BS_BITMAP OR _WS_DLGFRAME, 0, 0, 0&amp;lt;br/&amp;gt;    Button #demo.b3, &amp;amp;quot;&amp;amp;quot;, Click, UL, 20, 180, 50, 50&amp;lt;br/&amp;gt;    Stylebits #demo.b3, _BS_BITMAP OR _WS_BORDER, 0, 0, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Colorful Buttons&amp;amp;quot; for Window as #demo&amp;lt;br/&amp;gt;    #demo &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    hButton1 = hWnd(#demo.b1)&amp;lt;br/&amp;gt;    Call CreateBMPButton hButton1, hBmp1&amp;lt;br/&amp;gt;    hButton2 = hWnd(#demo.b2)&amp;lt;br/&amp;gt;    Call CreateBMPButton hButton2, hBmp2&amp;lt;br/&amp;gt;    hButton3 = hWnd(#demo.b3)&amp;lt;br/&amp;gt;    Call CreateBMPButton hButton3, hBmp3&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub EndDemo handle$&amp;lt;br/&amp;gt;    Close #demo&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub Click handle$&amp;lt;br/&amp;gt;    nButton$ = Right$(handle$, 1)&amp;lt;br/&amp;gt;    Notice &amp;amp;quot;Button #&amp;amp;quot;;nButton$;&amp;amp;quot; Clicked&amp;amp;quot;&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub CreateBMPButton hButton, hBmp&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;,_&amp;lt;br/&amp;gt;        hButton As uLong, _&amp;lt;br/&amp;gt;        _BM_SETIMAGE As Long,_&amp;lt;br/&amp;gt;        _IMAGE_BITMAP as long,_&amp;lt;br/&amp;gt;        hBmp As uLong,_&amp;lt;br/&amp;gt;        re As Long&amp;lt;br/&amp;gt;End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Function solidButton()&amp;lt;br/&amp;gt;    hue$ = &amp;amp;quot;128 0 128&amp;amp;quot;&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Backcolor &amp;amp;quot;;hue$&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Color &amp;amp;quot;;hue$&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Place 0 0&amp;amp;quot;&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Boxfilled 50 50&amp;amp;quot;&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Getbmp button1 1 1 50 50&amp;amp;quot;&amp;lt;br/&amp;gt;    solidButton = hBmp(&amp;amp;quot;button1&amp;amp;quot;)&amp;lt;br/&amp;gt;End Function&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Function varigatedButton()&amp;lt;br/&amp;gt;    c1 = 51: c2 = 101&amp;lt;br/&amp;gt;    blueHue = 232&amp;lt;br/&amp;gt;    For i = 1 to 25&amp;lt;br/&amp;gt;        #1 &amp;amp;quot;Color 0 0 &amp;amp;quot;;blueHue&amp;lt;br/&amp;gt;        #1 &amp;amp;quot;Place &amp;amp;quot;;c1;&amp;amp;quot; &amp;amp;quot;;c1&amp;lt;br/&amp;gt;        #1 &amp;amp;quot;Box &amp;amp;quot;;c2;&amp;amp;quot; &amp;amp;quot;;c2&amp;lt;br/&amp;gt;        c1 = c1+1: c2 = c2-1&amp;lt;br/&amp;gt;        blueHue = blueHue-8&amp;lt;br/&amp;gt;    Next i&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Flush&amp;amp;quot;&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Getbmp button2 51 51 50 50&amp;amp;quot;&amp;lt;br/&amp;gt;    varigatedButton = hBmp(&amp;amp;quot;button2&amp;amp;quot;)&amp;lt;br/&amp;gt;End Function&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Function stripedButton()&amp;lt;br/&amp;gt;    hueStrand$ = &amp;amp;quot;Red White Blue White Red&amp;amp;quot;&amp;lt;br/&amp;gt;    For i = 0 to 4&amp;lt;br/&amp;gt;        hue$ = Word$(hueStrand$, i+1)&amp;lt;br/&amp;gt;        #1, &amp;amp;quot;Color &amp;amp;quot;;hue$&amp;lt;br/&amp;gt;        For j = 1 to 10&amp;lt;br/&amp;gt;            #1, &amp;amp;quot;Line &amp;amp;quot;;50+i*10+j;&amp;amp;quot; 0 &amp;amp;quot;;50+i*10+j;&amp;amp;quot; 50&amp;amp;quot;&amp;lt;br/&amp;gt;        Next j&amp;lt;br/&amp;gt;    Next i&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Flush&amp;amp;quot;&amp;lt;br/&amp;gt;    #1 &amp;amp;quot;Getbmp button3 50 0 50 50&amp;amp;quot;&amp;lt;br/&amp;gt;    stripedButton = hBmp(&amp;amp;quot;button3&amp;amp;quot;)&amp;lt;br/&amp;gt;End Function&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.lb  {font-family:monospace;}
.lb .imp {font-weight: bold; color: red;}
.lb .kw1 {color: #0000FF;}
.lb .kw2 {color: #AD0080;}
.lb .kw3 {color: #008080;}
.lb .co1 {color: #666666; font-style: italic;}
.lb .coMULTI {color: #666666; font-style: italic;}
.lb .es0 {color: #000099; font-weight: bold;}
.lb .br0 {color: #009900;}
.lb .sy1 {color: #339933;}
.lb .st0 {color: #008000;}
.lb .nu0 {color: #FF0000;}
.lb .me0 {color: #004000;}
.lb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;lb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Demonstrates colorful buttons without first&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039; having to load bitmaps&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;600&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;560&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;UpperLeftX&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayWidth&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;WindowWidth&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;UpperLeftY&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DisplayHeight&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;WindowHeight&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Nomainwin&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Quick Draw&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Graphics&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Down&amp;quot;&lt;/span&gt;
    hBmp1 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; solidButton&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    hBmp2 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; varigatedButton&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    hBmp3 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; stripedButton&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Close&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.b1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.b1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _BS_BITMAP&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _WS_EX_CLIENTEDGE &lt;span class=&quot;kw1&quot;&gt;OR&lt;/span&gt; _WS_EX_DLGMODALFRAME&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.b2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.b2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _BS_BITMAP &lt;span class=&quot;kw1&quot;&gt;OR&lt;/span&gt; _WS_DLGFRAME&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.b3&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; Click&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; UL&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Stylebits&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.b3&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _BS_BITMAP &lt;span class=&quot;kw1&quot;&gt;OR&lt;/span&gt; _WS_BORDER&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Colorful Buttons&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Window&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    hButton1 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;hWnd&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.b1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; CreateBMPButton hButton1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; hBmp1
    hButton2 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;hWnd&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.b2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; CreateBMPButton hButton2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; hBmp2
    hButton3 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;hWnd&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo.b3&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Call&lt;/span&gt; CreateBMPButton hButton3&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; hBmp3
    &lt;span class=&quot;kw1&quot;&gt;Wait&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
    &lt;span class=&quot;kw1&quot;&gt;Close&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;demo
    &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Click handle$
    nButton$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Right$&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;handle$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Notice&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Button #&amp;quot;&lt;/span&gt;;nButton$;&lt;span class=&quot;st0&quot;&gt;&amp;quot; Clicked&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; CreateBMPButton hButton&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; hBmp
    &lt;span class=&quot;kw1&quot;&gt;CallDLL&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;user32&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
        hButton &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;uLong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; _
        _BM_SETIMAGE &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
        _IMAGE_BITMAP &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
        hBmp &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;uLong&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;_
        re &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; solidButton&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    hue$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;128 0 128&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Backcolor &amp;quot;&lt;/span&gt;;hue$
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color &amp;quot;&lt;/span&gt;;hue$
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 0 0&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Boxfilled 50 50&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Getbmp button1 1 1 50 50&amp;quot;&lt;/span&gt;
    solidButton &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;hBmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;button1&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; varigatedButton&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    c1 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;51&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; c2 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;101&lt;/span&gt;
    blueHue &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;232&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt;
        &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color 0 0 &amp;quot;&lt;/span&gt;;blueHue
        &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;c1;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;c1
        &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Box &amp;quot;&lt;/span&gt;;c2;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;c2
        c1 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; c1&lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; c2 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; c2&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
        blueHue &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; blueHue&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Flush&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Getbmp button2 51 51 50 50&amp;quot;&lt;/span&gt;
    varigatedButton &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;hBmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;button2&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; stripedButton&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    hueStrand$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Red White Blue White Red&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;
        hue$ &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Word&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;hueStrand$&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; i&lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color &amp;quot;&lt;/span&gt;;hue$
        &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; j &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
            &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Line &amp;quot;&lt;/span&gt;;&lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;i&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;j;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 0 &amp;quot;&lt;/span&gt;;&lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;i&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;j;&lt;span class=&quot;st0&quot;&gt;&amp;quot; 50&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; j
    &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Flush&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Getbmp button3 50 0 50 50&amp;quot;&lt;/span&gt;
    stripedButton &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;hBmp&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;button3&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;These are just some examples of what you can do with stylebits and buttons.  With experimentation, you may find more.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;x--A List of Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;A List of Stylebits&lt;/h3&gt;
&lt;br /&gt;
You can get a list of all &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632600(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwStyles&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwExStyles&lt;/a&gt; available with the Stylebits command at the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb775951(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;MSDN Library - Button Styles&lt;/a&gt;.</description>
          </item>
    <item>
      <title>Stylebits - Comboboxes</title>
      <link>https://lbpe.wikispaces.com/Stylebits+-+Comboboxes</link>
      <dc:creator>JanetTerra</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/Stylebits+-+Comboboxes</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/Stylebits+-+Comboboxes</comments>
      <pubDate>Fri, 27 Aug 2010 02:25:42 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:1:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x--Reviewing the Stylebits Parameters&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:1 --&gt;Reviewing the Stylebits Parameters&lt;/h3&gt;
&lt;br /&gt;
The four parameters of stylebits are AddBit, RemoveBit, AddExtendedBit, RemoveExtendedBit.  For a review of these four parameters, and an introduction to Stylebits in general, please view &lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Windows&quot;&gt;Stylebits - Windows&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
A combobox is a combination listbox and textbox.  Comboboxes are designed to save space by only showing the listbox when needed.  When the arrow button is clicked, the listbox drops down. The user can then mouse click an item from the loaded array.  The selected item is then printed in the textbox portion of the combobox.  In the standard combobox, it is also possible for the user to type an entry in the textbox that is not already a member of the array. Unlike other controls, comboboxes do not respond well to changes with border stylebits.  For this reason, the ExtendedBits aren&#039;t all that useful with comboboxes.  The stylebits _CBS_LOWERCASE and _CBS_UPPERCASE work quite well with comboboxes.  Even though _CBS_SORT is a documented Window&#039;s constant, I have never been able to sort a combobox array with the stylebit alone.  Fortunately alphabetizing is easily accomplished with Liberty BASIC&#039;s native SORT and RELOAD commands.  The stylebits that are most effective with comboboxes are _CBS_DROPDOWN, _CBS_DISABLENOSCROLL, _CBS_DROPDOWNLIST, and _CBS_AUTOHSCROLL.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:3:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x--The Listbox and the Textbox&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:3 --&gt;The Listbox and the Textbox&lt;/h3&gt;
&lt;br /&gt;
CBS_DROPDOWN as an AddBits is the standard combobox setting.  This allows the dropdown listbox.  Including _CBS_DROPDOWN in RemoveBits will keep the listbox visible at all times, rather than dropping down when needed.  The textbox allows user entry.  The listbox automatically scrolls to an item which satisfies the entry being typed.  Try typing in &amp;quot;July&amp;quot;, then backspace the &amp;quot;y&amp;quot; and &amp;quot;l&amp;quot; and continue with &amp;quot;ne&amp;quot; to see this scrolling in action.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; _CBS_DISABLENOSCROLL &lt;/strong&gt; &lt;/em&gt; draws a disabled scroll bar rather than no scroll bar when the dropdown listbox displays all array items.  This gives a more polished look to the listbox.  _CBS_DISABLEDNOSCROLL looks especially nice when coupled as an AddBits with the RemoveBits _CBS_DROPDOWN.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; _CBS_DROPDOWNLIST &lt;/strong&gt; &lt;/em&gt; used as an AddBits will cause the textbox to act as statictext rather than an edit control.  This will prevent users from typing into the textbox component of the combobox.  This is especially useful if you want your user to select only what&#039;s available in the combobox array.  Each keypress displays a member of the array with that initial character.  Repeating the character brings up the next array item with the same initial letter in alphabetical order.  You have probably seen this when prompted for your state abbreviation.  Repeatedly pressing the &#039;M&#039; brings up &amp;quot;Maine, Maryland, Massachusetts, etc.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; _CBS_AUTOHSCROLL &lt;/strong&gt; &lt;/em&gt; is another standard combobox default.  The textbox scrolls when the user types in characters beyond the visible width of the combobox.  By removing _CBS_AUTOHSCROLL, you can limit the number of characters typed by the user.  This is, of course, dependent upon the width of the combobox and the size and weight of the font.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:21:&amp;lt;img src=&amp;quot;/file/view/comboboxPic2.jpg/30100662/comboboxPic2.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/comboboxPic2.jpg/30100662/comboboxPic2.jpg&quot; alt=&quot;comboboxPic2.jpg&quot; title=&quot;comboboxPic2.jpg&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:21 --&gt;&lt;br /&gt;
&lt;br /&gt;
Probably the best way to see combobox stylebits effects are to see them in action.  In this demo, six comboboxes are each loaded with the same array.  Try mouse clicking and keyboard entry with all of them.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    WindowWidth = 400&amp;lt;br/&amp;gt;    WindowHeight = 500&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/3)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Dim month$(12)&amp;lt;br/&amp;gt;    For i = 1 to 12&amp;lt;br/&amp;gt;        Read m$&amp;lt;br/&amp;gt;        month$(i) = m$&amp;lt;br/&amp;gt;    Next i&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&#039;Set up a default button&amp;lt;br/&amp;gt;    Button #main.default, &amp;amp;quot;&amp;amp;quot;, selMonth, UL, -100, -100&amp;lt;br/&amp;gt;&#039;Remove default button from tabstop cycle&amp;lt;br/&amp;gt;    Stylebits #main.default, 0, _WS_TABSTOP, 0, 0&amp;lt;br/&amp;gt;&#039;The Standard Combobox&amp;lt;br/&amp;gt;    Statictext #main.st1, &amp;amp;quot;Standard&amp;amp;quot;, 30, 14, 100, 24&amp;lt;br/&amp;gt;    Combobox #main.cb1, month$(), selMonth, 30, 40, 100, 124&amp;lt;br/&amp;gt;&#039;Invisible Combobox; Not very practical.&amp;lt;br/&amp;gt;    Statictext #main.st2, &amp;amp;quot;Hidden&amp;amp;quot;, 150, 14, 100, 24&amp;lt;br/&amp;gt;    Combobox #main.cb2, month$(), selMonth, 150, 40, 100, 124&amp;lt;br/&amp;gt;    Stylebits #main.cb2, 0, _WS_VISIBLE, 0, 0&amp;lt;br/&amp;gt;&#039;Listbox stays visible at all times; Textbox accepts user input.&amp;lt;br/&amp;gt;    Statictext #main.s3, &amp;amp;quot;Visible Listbox&amp;amp;quot;, 270, 14, 100, 24&amp;lt;br/&amp;gt;    Combobox #main.cb3, month$(), selMonth, 270, 40, 100, 124&amp;lt;br/&amp;gt;    Stylebits #main.cb3, 0, _CBS_DROPDOWN, 0, 0&amp;lt;br/&amp;gt;&#039;Disabled vertical scroll bar when all items are visible&amp;lt;br/&amp;gt;    Statictext #main.st4, &amp;amp;quot;Disabled Unneeded Scrollbar&amp;amp;quot;, 30, 130, 100, 54&amp;lt;br/&amp;gt;    Combobox #main.cb4, month$(), selMonth, 30, 200, 100, 260&amp;lt;br/&amp;gt;    Stylebits #main.cb4, _CBS_DISABLENOSCROLL, _CBS_DROPDOWN, 0, 0&amp;lt;br/&amp;gt;&#039;Textbox doesn&#039;t accept user input, but instead selects Combobox item&amp;lt;br/&amp;gt;&#039;beginning with pressed character; Mouse clicking Textbox drops Listbox.&amp;lt;br/&amp;gt;    Statictext #main.st5, &amp;amp;quot;Keypress Initial&amp;amp;quot;, 150, 200, 100, 48&amp;lt;br/&amp;gt;    Combobox #main.cb5, month$(), selMonth, 150, 250, 100, 124&amp;lt;br/&amp;gt;    Stylebits #main.cb5, _CBS_DROPDOWNLIST, 0, 0, 0&amp;lt;br/&amp;gt;&#039;Limits user input to number of visible characters&amp;lt;br/&amp;gt;    Statictext #main.st6, &amp;amp;quot;Limit Number of Characters&amp;amp;quot;, 270, 200, 100, 48&amp;lt;br/&amp;gt;    Combobox #main.cb6, month$(), selMonth, 270, 250, 80, 124&amp;lt;br/&amp;gt;    Stylebits #main.cb6, 0, _CBS_AUTOHSCROLL, 0, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits and the Combobox&amp;amp;quot; for Dialog as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose [endDemo]&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.cb2 &amp;amp;quot;![Invisible]&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.cb1 &amp;amp;quot;Setfocus&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[endDemo]&amp;lt;br/&amp;gt;    Close #main&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub selMonth handle$&amp;lt;br/&amp;gt;        If handle$ = &amp;amp;quot;#main.default&amp;amp;quot; Then&amp;lt;br/&amp;gt;            #main.cb1 &amp;amp;quot;Contents? m1$&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.cb2 &amp;amp;quot;Contents? m2$&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.cb3 &amp;amp;quot;Contents? m3$&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.cb4 &amp;amp;quot;Contents? m4$&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.cb5 &amp;amp;quot;Contents? m5$&amp;amp;quot;&amp;lt;br/&amp;gt;            #main.cb6 &amp;amp;quot;Contents? m6$&amp;amp;quot;&amp;lt;br/&amp;gt;            month$ = &amp;amp;quot;The Textboxes Contents&amp;amp;quot; + Chr$(13) + _&amp;lt;br/&amp;gt;                &amp;amp;quot;Combobox 1: &amp;amp;quot;;m1$ + Chr$(13) + _&amp;lt;br/&amp;gt;                &amp;amp;quot;Combobox 2: &amp;amp;quot;;m2$ + Chr$(13) + _&amp;lt;br/&amp;gt;                &amp;amp;quot;Combobox 3: &amp;amp;quot;;m3$ + Chr$(13) + _&amp;lt;br/&amp;gt;                &amp;amp;quot;Combobox 4: &amp;amp;quot;;m4$ + Chr$(13) + _&amp;lt;br/&amp;gt;                &amp;amp;quot;Combobox 5: &amp;amp;quot;;m5$ + Chr$(13) + _&amp;lt;br/&amp;gt;                &amp;amp;quot;Combobox 6: &amp;amp;quot;;m6$ + Chr$(13)&amp;lt;br/&amp;gt;        Else&amp;lt;br/&amp;gt;            #handle$ &amp;amp;quot;Selectionindex? sel&amp;amp;quot;&amp;lt;br/&amp;gt;            month$ = month$(sel)&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;        Notice &amp;amp;quot;You chose &amp;amp;quot;;month$&amp;lt;br/&amp;gt;        #main.cb5 &amp;amp;quot;Reload&amp;amp;quot;&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Data &amp;amp;quot;January&amp;amp;quot;, &amp;amp;quot;February&amp;amp;quot;, &amp;amp;quot;March&amp;amp;quot;, &amp;amp;quot;April&amp;amp;quot;, &amp;amp;quot;May&amp;amp;quot;, &amp;amp;quot;June&amp;amp;quot;, &amp;amp;quot;July&amp;amp;quot;&amp;lt;br/&amp;gt;    Data &amp;amp;quot;August&amp;amp;quot;, &amp;amp;quot;September&amp;amp;quot;, &amp;amp;quot;October&amp;amp;quot;, &amp;amp;quot;November&amp;amp;quot;, &amp;amp;quot;December&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    WindowWidth = 400
    WindowHeight = 500
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/3)
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Dim&lt;/span&gt; month$(12)
    &lt;span class=&quot;kw3&quot;&gt;For&lt;/span&gt; i = 1 &lt;span class=&quot;kw3&quot;&gt;to&lt;/span&gt; 12
        Read m$
        month$(i) = m$
    &lt;span class=&quot;kw3&quot;&gt;Next&lt;/span&gt; i
&amp;nbsp;
    Nomainwin
&lt;span class=&quot;co1&quot;&gt;&#039;Set up a default button
&lt;/span&gt;    Button #main.default, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, selMonth, UL, -100, -100
&lt;span class=&quot;co1&quot;&gt;&#039;Remove default button from tabstop cycle
&lt;/span&gt;    Stylebits #main.default, 0, _WS_TABSTOP, 0, 0
&lt;span class=&quot;co1&quot;&gt;&#039;The Standard Combobox
&lt;/span&gt;    Statictext #main.st1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Standard&amp;quot;&lt;/span&gt;, 30, 14, 100, 24
    Combobox #main.cb1, month$(), selMonth, 30, 40, 100, 124
&lt;span class=&quot;co1&quot;&gt;&#039;Invisible Combobox; Not very practical.
&lt;/span&gt;    Statictext #main.st2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Hidden&amp;quot;&lt;/span&gt;, 150, 14, 100, 24
    Combobox #main.cb2, month$(), selMonth, 150, 40, 100, 124
    Stylebits #main.cb2, 0, _WS_VISIBLE, 0, 0
&lt;span class=&quot;co1&quot;&gt;&#039;Listbox stays visible at all times; Textbox accepts user input.
&lt;/span&gt;    Statictext #main.s3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Visible Listbox&amp;quot;&lt;/span&gt;, 270, 14, 100, 24
    Combobox #main.cb3, month$(), selMonth, 270, 40, 100, 124
    Stylebits #main.cb3, 0, _CBS_DROPDOWN, 0, 0
&lt;span class=&quot;co1&quot;&gt;&#039;Disabled vertical scroll bar when all items are visible
&lt;/span&gt;    Statictext #main.st4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Disabled Unneeded Scrollbar&amp;quot;&lt;/span&gt;, 30, 130, 100, 54
    Combobox #main.cb4, month$(), selMonth, 30, 200, 100, 260
    Stylebits #main.cb4, _CBS_DISABLENOSCROLL, _CBS_DROPDOWN, 0, 0
&lt;span class=&quot;co1&quot;&gt;&#039;Textbox doesn&#039;t accept user input, but instead selects Combobox item
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;beginning with pressed character; Mouse clicking Textbox drops Listbox.
&lt;/span&gt;    Statictext #main.st5, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Keypress Initial&amp;quot;&lt;/span&gt;, 150, 200, 100, 48
    Combobox #main.cb5, month$(), selMonth, 150, 250, 100, 124
    Stylebits #main.cb5, _CBS_DROPDOWNLIST, 0, 0, 0
&lt;span class=&quot;co1&quot;&gt;&#039;Limits user input to number of visible characters
&lt;/span&gt;    Statictext #main.st6, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Limit Number of Characters&amp;quot;&lt;/span&gt;, 270, 200, 100, 48
    Combobox #main.cb6, month$(), selMonth, 270, 250, 80, 124
    Stylebits #main.cb6, 0, _CBS_AUTOHSCROLL, 0, 0
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits and the Combobox&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Dialog &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [endDemo]&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #main.cb2 &lt;span class=&quot;st0&quot;&gt;&amp;quot;![Invisible]&amp;quot;&lt;/span&gt;
    #main.cb1 &lt;span class=&quot;st0&quot;&gt;&amp;quot;Setfocus&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Wait
&amp;nbsp;
[endDemo]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; selMonth handle$
        &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; handle$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;#main.default&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt;
            #main.cb1 &lt;span class=&quot;st0&quot;&gt;&amp;quot;Contents? m1$&amp;quot;&lt;/span&gt;
            #main.cb2 &lt;span class=&quot;st0&quot;&gt;&amp;quot;Contents? m2$&amp;quot;&lt;/span&gt;
            #main.cb3 &lt;span class=&quot;st0&quot;&gt;&amp;quot;Contents? m3$&amp;quot;&lt;/span&gt;
            #main.cb4 &lt;span class=&quot;st0&quot;&gt;&amp;quot;Contents? m4$&amp;quot;&lt;/span&gt;
            #main.cb5 &lt;span class=&quot;st0&quot;&gt;&amp;quot;Contents? m5$&amp;quot;&lt;/span&gt;
            #main.cb6 &lt;span class=&quot;st0&quot;&gt;&amp;quot;Contents? m6$&amp;quot;&lt;/span&gt;
            month$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;The Textboxes Contents&amp;quot;&lt;/span&gt; + Chr$(13) + _
                &lt;span class=&quot;st0&quot;&gt;&amp;quot;Combobox 1: &amp;quot;&lt;/span&gt;;m1$ + Chr$(13) + _
                &lt;span class=&quot;st0&quot;&gt;&amp;quot;Combobox 2: &amp;quot;&lt;/span&gt;;m2$ + Chr$(13) + _
                &lt;span class=&quot;st0&quot;&gt;&amp;quot;Combobox 3: &amp;quot;&lt;/span&gt;;m3$ + Chr$(13) + _
                &lt;span class=&quot;st0&quot;&gt;&amp;quot;Combobox 4: &amp;quot;&lt;/span&gt;;m4$ + Chr$(13) + _
                &lt;span class=&quot;st0&quot;&gt;&amp;quot;Combobox 5: &amp;quot;&lt;/span&gt;;m5$ + Chr$(13) + _
                &lt;span class=&quot;st0&quot;&gt;&amp;quot;Combobox 6: &amp;quot;&lt;/span&gt;;m6$ + Chr$(13)
        &lt;span class=&quot;kw3&quot;&gt;Else&lt;/span&gt;
            #handle$ &lt;span class=&quot;st0&quot;&gt;&amp;quot;Selectionindex? sel&amp;quot;&lt;/span&gt;
            month$ = month$(sel)
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt;
        Notice &lt;span class=&quot;st0&quot;&gt;&amp;quot;You chose &amp;quot;&lt;/span&gt;;month$
        #main.cb5 &lt;span class=&quot;st0&quot;&gt;&amp;quot;Reload&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    Data &lt;span class=&quot;st0&quot;&gt;&amp;quot;January&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;February&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;March&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;April&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;May&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;June&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;July&amp;quot;&lt;/span&gt;
    Data &lt;span class=&quot;st0&quot;&gt;&amp;quot;August&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;September&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;October&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;November&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;December&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x--Dialog Windows, Default Buttons and the TabStop Cycle&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;Dialog Windows, Default Buttons and the TabStop Cycle&lt;/h3&gt;
&lt;br /&gt;
The advantage of placing comboboxes on a dialog window is the use of the default button.  A dialog window can have a default button that is activated when the user hits the ENTER key even if that button is not the control with focus.  The default button must have the .default extension.  In the above demo, the default button is used to read the contents of the textbox portion of each combobox.  If you tab from one control to another, you will find that every sixth tab press appears to do nothing.  The second combobox is not the culprit.  Because it&#039;s hidden, that combobox is not receiving focus.  It is the default button that lies off the window, but still able to receive focus.  The stylebits _WS_TABSTOP as a RemoveBits for the default button removes the button from the tab cycle.  The user can now tab through the five comboboxes without skipping a beat.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x--A List of Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;A List of Stylebits&lt;/h3&gt;
&lt;br /&gt;
You can get a list of all &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632600(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwStyles&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwExStyles&lt;/a&gt; available with the Stylebits command at the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb775796(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;MSDN Library - Combo Box Styles&lt;/a&gt;.</description>
          </item>
    <item>
      <title>Stylebits - Dialog Windows</title>
      <link>https://lbpe.wikispaces.com/Stylebits+-+Dialog+Windows</link>
      <dc:creator>JanetTerra</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/Stylebits+-+Dialog+Windows</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/Stylebits+-+Dialog+Windows</comments>
      <pubDate>Sun, 13 Sep 2015 23:45:16 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x--Reviewing the Stylebits Parameters&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Reviewing the Stylebits Parameters&lt;/h3&gt;
 &lt;br /&gt;
The four parameters of stylebits are AddBit, RemoveBit, AddExtendedBit, RemoveExtendedBit. For a review of these four parameters, and an introduction to Stylebits in general, please view &lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Windows&quot;&gt;Stylebits - Windows&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x--Why a Dialog Window?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;Why a Dialog Window?&lt;/h3&gt;
 &lt;br /&gt;
There are several reasons you might want to use a dialog window in your program. A common reason is the default button. Without stylebits, only dialog windows are capable of default buttons. From the Liberty BASIC help file:&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;A window of type DIALOG can contain a button with the extension &amp;quot;.default&amp;quot;. If the user presses the ENTER key while the dialog window has focus, it is the same as if the button whose extension is &amp;quot;default&amp;quot; is pressed and program execution will continue at the event handler [branchLabel] for that button.&lt;/em&gt; &lt;br /&gt;
&lt;br /&gt;
The following code is a simple program illustrating the default button.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Statictext #dlg.txt, &amp;amp;quot;Press Okay to close this window.&amp;amp;quot;, 20, 50, 100, 20&amp;lt;br/&amp;gt;    Button #dlg.default, &amp;amp;quot; Okay &amp;amp;quot;, [OkayButton], UL, 140, 100&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Default Button&amp;amp;quot; for Dialog as #dlg&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[OkayButton]&amp;lt;br/&amp;gt;    Close #dlg&amp;lt;br/&amp;gt;    End&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Statictext #dlg.txt, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Press Okay to close this window.&amp;quot;&lt;/span&gt;, 20, 50, 100, 20
    Button #dlg.default, &lt;span class=&quot;st0&quot;&gt;&amp;quot; Okay &amp;quot;&lt;/span&gt;, [OkayButton], UL, 140, 100
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Default Button&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Dialog &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #dlg
    Wait
&amp;nbsp;
[OkayButton]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #dlg
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x--The Choice: A Default Button or a Menu&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;The Choice: A Default Button or a Menu&lt;/h3&gt;
 &lt;br /&gt;
Unfortunately, dialog windows do not support menus. For a long time, Liberty BASIC programmers have had to choose between a default button and a menu. Recently, Brent Thorn posted code using Stylebits that will allow a default button in a regular window. So, while you still can&#039;t program a menu in a dialog window, you can code a default button in a regular window. This means a default button AND a menu in the same window. Thanks, Brent! One peculiarity I did discover was that one of the window controls needs to be given focus prior to the activation of the default button. A simple Setfocus to a textbox (any textbox) will accomplish that. Here is a modification of Brent&#039;s code.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;&#039;Using a Dialog Default Button in a Regular Window&amp;lt;br/&amp;gt;&#039;Thanks to Brent Thorn&amp;lt;br/&amp;gt;&#039; http://libertybasic.conforums.com/index.cgi?board=novice&amp;amp;amp;action=display&amp;amp;amp;num=1134254812&amp;lt;br/&amp;gt;&#039;Modifications by Janet = Menu and Setfocus to #main.tbx1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    WindowWidth = 300&amp;lt;br/&amp;gt;    WindowHeight = 350&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Menu #main, &amp;amp;quot;&amp;amp;amp;Options&amp;amp;quot;, &amp;amp;quot;E&amp;amp;amp;xit&amp;amp;quot;, EndDemoMenu&amp;lt;br/&amp;gt;    Textbox #main.tbx1, 150, 50, 120, 30&amp;lt;br/&amp;gt;    Textbox #main.tbx2, 150, 100, 120, 30&amp;lt;br/&amp;gt;    Textbox #main.tbx3, 150, 150, 120, 30&amp;lt;br/&amp;gt;    Textbox #main.tbx4, 150, 200, 120, 30&amp;lt;br/&amp;gt;    Stylebits #main.default, _BS_DEFPUSHBUTTON, 0, 0, 0&amp;lt;br/&amp;gt;    Button #main.default, &amp;amp;quot;&amp;amp;quot;, DefaultButton, UL, -100, -100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Default Button in a Regular Window&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.tbx1 &amp;amp;quot;!Setfocus&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub DefaultButton handle$&amp;lt;br/&amp;gt;        #main.tbx1 &amp;amp;quot;!Contents? text1$&amp;amp;quot;&amp;lt;br/&amp;gt;        #main.tbx2 &amp;amp;quot;!Contents? text2$&amp;amp;quot;&amp;lt;br/&amp;gt;        #main.tbx3 &amp;amp;quot;!Contents? text3$&amp;amp;quot;&amp;lt;br/&amp;gt;        #main.tbx4 &amp;amp;quot;!Contents? text4$&amp;amp;quot;&amp;lt;br/&amp;gt;        Notice &amp;amp;quot;The textboxes read&amp;amp;quot;;Chr$(13);Chr$(13) + _&amp;lt;br/&amp;gt;            text1$;Chr$(13);text2$;Chr$(13);text3$;Chr$(13);text4$&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemoMenu&amp;lt;br/&amp;gt;        Call EndDemo &amp;amp;quot;#main&amp;amp;quot;&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemo handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;    End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Using a Dialog Default Button in a Regular Window
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Thanks to Brent Thorn
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039; http://libertybasic.conforums.com/index.cgi?board=novice&amp;amp;action=display&amp;amp;num=1134254812
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Modifications by Janet = Menu and Setfocus to #main.tbx1
&lt;/span&gt;
    WindowWidth = 300
    WindowHeight = 350
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
&amp;nbsp;
    Menu #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;amp;Options&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;E&amp;amp;xit&amp;quot;&lt;/span&gt;, EndDemoMenu
    Textbox #main.tbx1, 150, 50, 120, 30
    Textbox #main.tbx2, 150, 100, 120, 30
    Textbox #main.tbx3, 150, 150, 120, 30
    Textbox #main.tbx4, 150, 200, 120, 30
    Stylebits #main.default, _BS_DEFPUSHBUTTON, 0, 0, 0
    Button #main.default, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, DefaultButton, UL, -100, -100
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Default Button in a Regular Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    #main.tbx1 &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Setfocus&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; DefaultButton handle$
        #main.tbx1 &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? text1$&amp;quot;&lt;/span&gt;
        #main.tbx2 &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? text2$&amp;quot;&lt;/span&gt;
        #main.tbx3 &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? text3$&amp;quot;&lt;/span&gt;
        #main.tbx4 &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? text4$&amp;quot;&lt;/span&gt;
        Notice &lt;span class=&quot;st0&quot;&gt;&amp;quot;The textboxes read&amp;quot;&lt;/span&gt;;Chr$(13);Chr$(13) + _
            text1$;Chr$(13);text2$;Chr$(13);text3$;Chr$(13);text4$
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; EndDemoMenu
        &lt;span class=&quot;kw2&quot;&gt;Call&lt;/span&gt; EndDemo &lt;span class=&quot;st0&quot;&gt;&amp;quot;#main&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:23:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@StylebitsTextbox&amp;quot; title=&amp;quot;Anchor: StylebitsTextbox&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;StylebitsTextbox&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:23 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x--An Improved Stylebits Textbox&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;An Improved Stylebits Textbox&lt;/h3&gt;
 Since the release of Liberty BASIC 4.0 and stylebits, multilines and wordwrapping have been accomplished in textboxes using the sequence _WS_VSCROLL OR _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0. &lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Textboxes&quot;&gt;Stylebits - Textboxes&lt;/a&gt; discusses such a textbox. While the text does, indeed, wrap, the user must resort to CTRL - Enter to force a line feed. Using a hidden button with the stylebit _BS_DEFPUSHBUTTON allows the program to retrieve the contents of the textbox, append Chr$(13);Chr$(10) to the text, then rewrite that text to the textbox. Now the textbox behaves just like any other word processing tool. As is common with so many of the Stylebits tricks, an API call is required to add the final polish. With native Liberty BASIC code, the cursor is placed in front of any text that&#039;s been printed in a textbox. The API call &amp;quot;SendMessageA&amp;quot; can be used to position the cursor at the end of the text instead. This cursor position makes keyboarding a more natural and fluent activity.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    WindowWidth = 400&amp;lt;br/&amp;gt;    WindowHeight = 300&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Add a Textbox with Word Wrapping Capability&amp;lt;br/&amp;gt;    Stylebits #main.tbx, _WS_VSCROLL OR _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0&amp;lt;br/&amp;gt;    Textbox #main.tbx, 20, 20, 150, 200&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039; Add a Hidden Default Button - Use Stylebits Addbits _BS_DEFPUSHBUTTON&amp;lt;br/&amp;gt;    Stylebits #main.btn, _BS_DEFPUSHBUTTON, 0, 0, 0&amp;lt;br/&amp;gt;    Button #main.btn, &amp;amp;quot;&amp;amp;quot;, DefaultButton, UL, -10, -10&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Main Window&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Verdana 10 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.tbx &amp;amp;quot;!Setfocus&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemo handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub DefaultButton handle$&amp;lt;br/&amp;gt;        hTextbox = hWnd(#main.tbx)&amp;lt;br/&amp;gt;        #main.tbx &amp;amp;quot;!Contents? text$&amp;amp;quot;&amp;lt;br/&amp;gt;        text$ = text$;Chr$(13);Chr$(10)&amp;lt;br/&amp;gt;        #main.tbx text$&amp;lt;br/&amp;gt;        pos = Len(text$)&amp;lt;br/&amp;gt;        CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;            hTextbox as Ulong, _&amp;lt;br/&amp;gt;            _EM_SETSEL as Long, _&amp;lt;br/&amp;gt;            pos as Long, _&amp;lt;br/&amp;gt;            pos as Long, _&amp;lt;br/&amp;gt;            result as Long&amp;lt;br/&amp;gt;    End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Nomainwin
&amp;nbsp;
    WindowWidth = 400
    WindowHeight = 300
&amp;nbsp;
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Add a Textbox with Word Wrapping Capability
&lt;/span&gt;    Stylebits #main.tbx, _WS_VSCROLL &lt;span class=&quot;kw3&quot;&gt;OR&lt;/span&gt; _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0
    Textbox #main.tbx, 20, 20, 150, 200
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039; Add a Hidden Default Button - Use Stylebits Addbits _BS_DEFPUSHBUTTON
&lt;/span&gt;    Stylebits #main.btn, _BS_DEFPUSHBUTTON, 0, 0, 0
    Button #main.btn, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, DefaultButton, UL, -10, -10
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Main Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Verdana 10 Bold&amp;quot;&lt;/span&gt;
    #main.tbx &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Setfocus&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; DefaultButton handle$
        hTextbox = hWnd(#main.tbx)
        #main.tbx &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Contents? text$&amp;quot;&lt;/span&gt;
        text$ = text$;Chr$(13);Chr$(10)
        #main.tbx text$
        pos = Len(text$)
        CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;, _
            hTextbox &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Ulong, _
            _EM_SETSEL &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
            pos &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
            pos &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
            result &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;em&gt;If you desire or need a truly editable textbox that mimics a text editor, use Alyce Watson&#039;s free API Text Editor available at &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.alycesrestaurant.com&quot; rel=&quot;nofollow&quot;&gt;Alyce&#039;s Restaurant&lt;/a&gt;.&lt;/em&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;x--Resizing a Dialog Window&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;Resizing a Dialog Window&lt;/h3&gt;
 &lt;br /&gt;
The borders of a native dialog Window (default style = _WS_DLGFRAME) cannot be resized by the user. Neither can the dialog window be maximized or minimized.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    WindowWidth = 300&amp;lt;br/&amp;gt;    WindowHeight = 350&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Testing&amp;amp;quot; for Dialog as #dlg&amp;lt;br/&amp;gt;    #dlg &amp;amp;quot;Trapclose CloseDlg&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub CloseDlg handle$&amp;lt;br/&amp;gt;        Close #dlg&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;    End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Nomainwin
    WindowWidth = 300
    WindowHeight = 350
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Testing&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Dialog &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #dlg
    #dlg &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose CloseDlg&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; CloseDlg handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #dlg
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;In a regular window, you can use _WS_MAXIMIZEBOX or _WS_MINIMIZEBOX in RemoveBits to remove the Maximize and Minimize Controls. In a dialog window, place one or both of these stylebits in the AddBits. To allow border resizing, add the stylebit _WS_THICKFRAME&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;&#039;Demo illustrating a Dialog Window with Resizable Edges&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    WindowWidth = 800&amp;lt;br/&amp;gt;    WindowHeight = 600&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Button #main.b1, &amp;amp;quot;  Normal Dialog Window  &amp;amp;quot;, DialogWin1, UL, 320, 250&amp;lt;br/&amp;gt;    Button #main.b2, &amp;amp;quot; Stylebits Dialog Window &amp;amp;quot;, DialogWin2, UL, 320, 300&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Main Window&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub EndDemo handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;        End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub DialogWin1 handle$&amp;lt;br/&amp;gt;        WindowWidth = 400&amp;lt;br/&amp;gt;        WindowHeight = 300&amp;lt;br/&amp;gt;        Stylebits #dlg, 0, 0, 0, 0&amp;lt;br/&amp;gt;        Button #dlg.default, &amp;amp;quot; Close &amp;amp;quot;, CloseDlg, UL, 180, 200&amp;lt;br/&amp;gt;        Open &amp;amp;quot;Dialog Window&amp;amp;quot; for Dialog_Modal as #dlg&amp;lt;br/&amp;gt;        #dlg &amp;amp;quot;Trapclose CloseDlg&amp;amp;quot;&amp;lt;br/&amp;gt;        End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub DialogWin2 handle$&amp;lt;br/&amp;gt;        WindowWidth = 400&amp;lt;br/&amp;gt;        WindowHeight = 300&amp;lt;br/&amp;gt;        Stylebits #dlg, _WS_THICKFRAME or _DS_CENTER or _WS_MAXIMIZEBOX or _WS_MINIMIZEBOX, 0, 0, 0&amp;lt;br/&amp;gt;        Button #dlg.default, &amp;amp;quot; Close &amp;amp;quot;, CloseDlg, UL, 180, 200&amp;lt;br/&amp;gt;        Open &amp;amp;quot;Dialog Window&amp;amp;quot; for Dialog_Modal as #dlg&amp;lt;br/&amp;gt;        #dlg &amp;amp;quot;Trapclose CloseDlg&amp;amp;quot;&amp;lt;br/&amp;gt;        End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub CloseDlg handle$&amp;lt;br/&amp;gt;        Close #dlg&amp;lt;br/&amp;gt;        End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Demo illustrating a Dialog Window with Resizable Edges
&lt;/span&gt;
    Nomainwin
&amp;nbsp;
    WindowWidth = 800
    WindowHeight = 600
&amp;nbsp;
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
&amp;nbsp;
    Button #main.b1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;  Normal Dialog Window  &amp;quot;&lt;/span&gt;, DialogWin1, UL, 320, 250
    Button #main.b2, &lt;span class=&quot;st0&quot;&gt;&amp;quot; Stylebits Dialog Window &amp;quot;&lt;/span&gt;, DialogWin2, UL, 320, 300
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Main Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; DialogWin1 handle$
        WindowWidth = 400
        WindowHeight = 300
        Stylebits #dlg, 0, 0, 0, 0
        Button #dlg.default, &lt;span class=&quot;st0&quot;&gt;&amp;quot; Close &amp;quot;&lt;/span&gt;, CloseDlg, UL, 180, 200
        &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Dialog Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Dialog_Modal &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #dlg
        #dlg &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose CloseDlg&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; DialogWin2 handle$
        WindowWidth = 400
        WindowHeight = 300
        Stylebits #dlg, _WS_THICKFRAME &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _DS_CENTER &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _WS_MAXIMIZEBOX &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _WS_MINIMIZEBOX, 0, 0, 0
        Button #dlg.default, &lt;span class=&quot;st0&quot;&gt;&amp;quot; Close &amp;quot;&lt;/span&gt;, CloseDlg, UL, 180, 200
        &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Dialog Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Dialog_Modal &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #dlg
        #dlg &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose CloseDlg&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; CloseDlg handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #dlg
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;Don&#039;t expect to be able to issue a resizehandler control to this modified dialog window, though. The resizehandler command wasn&#039;t designed to work with a dialog window, not even a &#039;stylebitized&#039; dialog window.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;x--Positioning a Dialog Window&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;Positioning a Dialog Window&lt;/h3&gt;
 A dialog window can easily be centered using the Stylebit _DS_CENTER. See Tip Corner - Center a Dialog with Stylebits by Alyce Watson in the Liberty BASIC Newsletter Issue #128. This centering is in relationship to the screen (monitor) display. By default, dialog windows position themselves according to the client (calling window) area. In the following demo, move the main window (#main) around the screen prior to opening the dialog window. The dialog window will always position itself according to the position of the main window.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    WindowWidth = 600&amp;lt;br/&amp;gt;    WindowHeight = 400&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Button #main.dlg, &amp;amp;quot;Native Dialog&amp;amp;quot;, dlg, UL, 220, 200, 140, 30&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits and Dialogs&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub CloseMain handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub CloseDlg handle$&amp;lt;br/&amp;gt;        Close #handle$&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub dlg handle$&amp;lt;br/&amp;gt;        WindowWidth = 300&amp;lt;br/&amp;gt;        WindowHeight = 250&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        UpperLeftX = 20 &#039;UpperLeftX 20 pixels to right of #main upper left corner&amp;lt;br/&amp;gt;        UpperLeftY = 20 &#039;UpperLeftY 20 pixels down from #main upper left corner&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        text$ = &amp;amp;quot;UpperLeftX and UpperLeftY are, by default, based upon the client &amp;amp;quot;&amp;lt;br/&amp;gt;        text$ = text$;&amp;amp;quot;coordinates of the calling window and not the screen coordinates.&amp;amp;quot;&amp;lt;br/&amp;gt;        text$ = text$;Chr$(13);Chr$(13);&amp;amp;quot;UpperLeftX = 20&amp;amp;quot;;Chr$(13);&amp;amp;quot;UpperLeftY = 20&amp;amp;quot;&amp;lt;br/&amp;gt;        Statictext #dlg1, text$, 50, 50, 200, 200&amp;lt;br/&amp;gt;        Open &amp;amp;quot;Dialog - No Stylebits&amp;amp;quot; for Dialog_Modal as #dlg&amp;lt;br/&amp;gt;        #dlg &amp;amp;quot;Trapclose CloseDlg&amp;amp;quot;&amp;lt;br/&amp;gt;    End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Nomainwin
    WindowWidth = 600
    WindowHeight = 400
&amp;nbsp;
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
&amp;nbsp;
    Button #main.dlg, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Native Dialog&amp;quot;&lt;/span&gt;, dlg, UL, 220, 200, 140, 30
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits and Dialogs&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; CloseMain handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; CloseDlg handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #handle$
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; dlg handle$
        WindowWidth = 300
        WindowHeight = 250
&amp;nbsp;
        UpperLeftX = 20 &lt;span class=&quot;co1&quot;&gt;&#039;UpperLeftX 20 pixels to right of #main upper left corner
&lt;/span&gt;        UpperLeftY = 20 &lt;span class=&quot;co1&quot;&gt;&#039;UpperLeftY 20 pixels down from #main upper left corner
&lt;/span&gt;
        text$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;UpperLeftX and UpperLeftY are, by default, based upon the client &amp;quot;&lt;/span&gt;
        text$ = text$;&lt;span class=&quot;st0&quot;&gt;&amp;quot;coordinates of the calling window and not the screen coordinates.&amp;quot;&lt;/span&gt;
        text$ = text$;Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;UpperLeftX = 20&amp;quot;&lt;/span&gt;;Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;UpperLeftY = 20&amp;quot;&lt;/span&gt;
        Statictext #dlg1, text$, 50, 50, 200, 200
        &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Dialog - No Stylebits&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Dialog_Modal &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #dlg
        #dlg &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose CloseDlg&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;If your program requires a dialog window to be placed according to screen coordinates, use the stylebit _DS_ABSALIGN.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    WindowWidth = 600&amp;lt;br/&amp;gt;    WindowHeight = 400&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Button #main.dlg, &amp;amp;quot;_DS_ABSALIGN&amp;amp;quot;, dlg, UL, 220, 200, 140, 30&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits and Dialogs&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub CloseMain handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub CloseDlg handle$&amp;lt;br/&amp;gt;        Close #handle$&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub dlg handle$&amp;lt;br/&amp;gt;        WindowWidth = 300&amp;lt;br/&amp;gt;        WindowHeight = 250&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        UpperLeftX = 20 &#039;UpperLeftX 20 pixels to right of upper left screen corner&amp;lt;br/&amp;gt;        UpperLeftY = 20 &#039;UpperLeftY 20 pixels down from upper left screen corner&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        text$ = &amp;amp;quot;_DS_ABSALIGN causes the UpperLeftX and UpperLeftY to be &amp;amp;quot;&amp;lt;br/&amp;gt;        text$ = text$;&amp;amp;quot;determined not as client coordinates but as screen coordinates.&amp;amp;quot;&amp;lt;br/&amp;gt;        text$ = text$;Chr$(13);Chr$(13);&amp;amp;quot;UpperLeftX = 20&amp;amp;quot;;Chr$(13);&amp;amp;quot;UpperLeftY = 20&amp;amp;quot;&amp;lt;br/&amp;gt;        Statictext #dlg, text$, 50, 50, 200, 200&amp;lt;br/&amp;gt;        Stylebits #dlg, _DS_ABSALIGN, 0, 0, 0&amp;lt;br/&amp;gt;        Open &amp;amp;quot;Dialog - _DS_ABSALIGN&amp;amp;quot; for Dialog_Modal as #dlg&amp;lt;br/&amp;gt;        #dlg &amp;amp;quot;Trapclose CloseDlg&amp;amp;quot;&amp;lt;br/&amp;gt;    End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Nomainwin
    WindowWidth = 600
    WindowHeight = 400
&amp;nbsp;
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
&amp;nbsp;
    Button #main.dlg, &lt;span class=&quot;st0&quot;&gt;&amp;quot;_DS_ABSALIGN&amp;quot;&lt;/span&gt;, dlg, UL, 220, 200, 140, 30
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits and Dialogs&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; CloseMain handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; CloseDlg handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #handle$
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; dlg handle$
        WindowWidth = 300
        WindowHeight = 250
&amp;nbsp;
        UpperLeftX = 20 &lt;span class=&quot;co1&quot;&gt;&#039;UpperLeftX 20 pixels to right of upper left screen corner
&lt;/span&gt;        UpperLeftY = 20 &lt;span class=&quot;co1&quot;&gt;&#039;UpperLeftY 20 pixels down from upper left screen corner
&lt;/span&gt;
        text$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;_DS_ABSALIGN causes the UpperLeftX and UpperLeftY to be &amp;quot;&lt;/span&gt;
        text$ = text$;&lt;span class=&quot;st0&quot;&gt;&amp;quot;determined not as client coordinates but as screen coordinates.&amp;quot;&lt;/span&gt;
        text$ = text$;Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;UpperLeftX = 20&amp;quot;&lt;/span&gt;;Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;UpperLeftY = 20&amp;quot;&lt;/span&gt;
        Statictext #dlg, text$, 50, 50, 200, 200
        Stylebits #dlg, _DS_ABSALIGN, 0, 0, 0
        &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Dialog - _DS_ABSALIGN&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Dialog_Modal &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #dlg
        #dlg &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose CloseDlg&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;One other coordinate positioning trick can be accomplished with stylebits. Assigning the stylebit _DS_CENTERMOUSE will cause the dialog window to position itself so that the cursor lies in the center of the dialog window.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    WindowWidth = 600&amp;lt;br/&amp;gt;    WindowHeight = 400&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;All 4 Buttons Call Same Sub&amp;lt;br/&amp;gt;    Button #main.dlg1, &amp;amp;quot;Mouse Centered Dialog&amp;amp;quot;, dlg, UL, 20, 80, 140, 30&amp;lt;br/&amp;gt;    Button #main.dlg2, &amp;amp;quot;Mouse Centered Dialog&amp;amp;quot;, dlg, UL, 160, 120, 140, 30&amp;lt;br/&amp;gt;    Button #main.dlg3, &amp;amp;quot;Mouse Centered Dialog&amp;amp;quot;, dlg, UL, 300, 220, 140, 30&amp;lt;br/&amp;gt;    Button #main.dlg4, &amp;amp;quot;Mouse Centered Dialog&amp;amp;quot;, dlg, UL, 400, 300, 140, 30&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits and Dialogs&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose CloseMain&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub CloseMain handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub CloseDlg handle$&amp;lt;br/&amp;gt;        Close #handle$&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub dlg handle$&amp;lt;br/&amp;gt;        WindowWidth = 300&amp;lt;br/&amp;gt;        WindowHeight = 250&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        UpperLeftX = 20 &#039;UpperLeftX will be ignored&amp;lt;br/&amp;gt;        UpperLeftY = 20 &#039;UpperLeftY will be ignored&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        Stylebits #dlg, _DS_CENTERMOUSE, 0, 0, 0&amp;lt;br/&amp;gt;        Open &amp;amp;quot;Dialog - _DS_CENTERMOUSE&amp;amp;quot; for Dialog_Modal as #dlg&amp;lt;br/&amp;gt;        #dlg &amp;amp;quot;Trapclose CloseDlg&amp;amp;quot;&amp;lt;br/&amp;gt;    End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Nomainwin
    WindowWidth = 600
    WindowHeight = 400
&amp;nbsp;
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;All 4 Buttons Call Same Sub
&lt;/span&gt;    Button #main.dlg1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Mouse Centered Dialog&amp;quot;&lt;/span&gt;, dlg, UL, 20, 80, 140, 30
    Button #main.dlg2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Mouse Centered Dialog&amp;quot;&lt;/span&gt;, dlg, UL, 160, 120, 140, 30
    Button #main.dlg3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Mouse Centered Dialog&amp;quot;&lt;/span&gt;, dlg, UL, 300, 220, 140, 30
    Button #main.dlg4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Mouse Centered Dialog&amp;quot;&lt;/span&gt;, dlg, UL, 400, 300, 140, 30
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits and Dialogs&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
&amp;nbsp;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose CloseMain&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; CloseMain handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; CloseDlg handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #handle$
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; dlg handle$
        WindowWidth = 300
        WindowHeight = 250
&amp;nbsp;
        UpperLeftX = 20 &lt;span class=&quot;co1&quot;&gt;&#039;UpperLeftX will be ignored
&lt;/span&gt;        UpperLeftY = 20 &lt;span class=&quot;co1&quot;&gt;&#039;UpperLeftY will be ignored
&lt;/span&gt;
        Stylebits #dlg, _DS_CENTERMOUSE, 0, 0, 0
        &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Dialog - _DS_CENTERMOUSE&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Dialog_Modal &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #dlg
        #dlg &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose CloseDlg&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;A dialog window can also be positioned in the forefront of all other windows, even when that dialog window isn&#039;t the window with focus. The _DS_SYSMODAL stylebit acts the same as the _WS_EX_TOPMOST stylebit for regular windows.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    WindowWidth = 600&amp;lt;br/&amp;gt;    WindowHeight = 400&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;All 4 Buttons Call Same Sub&amp;lt;br/&amp;gt;    Button #main.dlg, &amp;amp;quot;_DS_SYSMODAL&amp;amp;quot;, dlg, UL, 220, 200, 140, 30&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits and Dialogs&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose CloseMain&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub CloseMain handle$&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub CloseDlg handle$&amp;lt;br/&amp;gt;        Close #handle$&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub dlg handle$&amp;lt;br/&amp;gt;        WindowWidth = 300&amp;lt;br/&amp;gt;        WindowHeight = 250&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        UpperLeftX = 20&amp;lt;br/&amp;gt;        UpperLeftY = 20&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        Stylebits #dlg, _DS_SYSMODAL, 0, 0, 0&amp;lt;br/&amp;gt;        Open &amp;amp;quot;Dialog - _DS_SYSMODAL&amp;amp;quot; for Dialog as #dlg&amp;lt;br/&amp;gt;        #dlg &amp;amp;quot;Trapclose CloseDlg&amp;amp;quot;&amp;lt;br/&amp;gt;    End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Nomainwin
    WindowWidth = 600
    WindowHeight = 400
&amp;nbsp;
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;All 4 Buttons Call Same Sub
&lt;/span&gt;    Button #main.dlg, &lt;span class=&quot;st0&quot;&gt;&amp;quot;_DS_SYSMODAL&amp;quot;&lt;/span&gt;, dlg, UL, 220, 200, 140, 30
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits and Dialogs&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
&amp;nbsp;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose CloseMain&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; CloseMain handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; CloseDlg handle$
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #handle$
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; dlg handle$
        WindowWidth = 300
        WindowHeight = 250
&amp;nbsp;
        UpperLeftX = 20
        UpperLeftY = 20
&amp;nbsp;
        Stylebits #dlg, _DS_SYSMODAL, 0, 0, 0
        &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Dialog - _DS_SYSMODAL&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Dialog &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #dlg
        #dlg &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose CloseDlg&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;x--A List of Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;A List of Stylebits&lt;/h3&gt;
 &lt;br /&gt;
You can get a list of all &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632600(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwStyles&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwExStyles&lt;/a&gt; available with the Stylebits command at the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms644994(VS.85).aspx#styles&quot; rel=&quot;nofollow&quot;&gt;MSDN Library - Dialog Styles&lt;/a&gt;.&lt;br /&gt;
Be sure to precede these constants with an underscore (if constant is DS_CENTERMOUSE, then LB Stylebits is _DS_CENTERMOUSE) when using Windows constants in your Liberty BASIC programs.</description>
          </item>
    <item>
      <title>Stylebits - Listboxes</title>
      <link>https://lbpe.wikispaces.com/Stylebits+-+Listboxes</link>
      <dc:creator>JanetTerra</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/Stylebits+-+Listboxes</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/Stylebits+-+Listboxes</comments>
      <pubDate>Fri, 27 Aug 2010 02:33:11 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x--Reviewing the Stylebits Parameters&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;Reviewing the Stylebits Parameters&lt;/h3&gt;
&lt;br /&gt;
The four parameters of stylebits are AddBit, RemoveBit, AddExtendedBit, RemoveExtendedBit.  For a review of these four parameters, and an introduction to Stylebits in general, please view &lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Windows&quot;&gt;Stylebits - Windows&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x--Listboxes and Colors&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;Listboxes and Colors&lt;/h3&gt;
&lt;br /&gt;
The native listbox is black text against a white background.  To change the background color to match the default color of the user&#039;s scheme, include&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;ListboxColor$ = &amp;amp;quot;Buttonface&amp;amp;quot;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;ListboxColor$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Buttonface&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;prior to defining that listbox.  Change the ListboxColor$ to white (or any other valid color) for subsequent listboxes if desired.  To change the color of the text, use ForegroundColor$ before opening the window.  Only one color may be assigned to all controls with ForegroundColor$.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x--Stylebits, Listboxes and Borders&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;Stylebits, Listboxes and Borders&lt;/h3&gt;
&lt;br /&gt;
The default border is single edged.  Techniques to change the border of a listbox are similar to changing the border of a window, textbox or any other control.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; Borderless &lt;/strong&gt; &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;ListboxColor$ = &amp;amp;quot;Buttonface&amp;amp;quot;&amp;lt;br/&amp;gt;Stylebits #style.lb1, 0, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;ListboxColor$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Buttonface&amp;quot;&lt;/span&gt;
Stylebits #style.lb1, 0, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; Sunken Border &lt;/strong&gt; &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #style.lb2, 0, 0, _WS_EX_CLIENTEDGE or _WS_EX_STATICEDGE, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #style.lb2, 0, 0, _WS_EX_CLIENTEDGE &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _WS_EX_STATICEDGE, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; Raised Border &lt;/strong&gt; &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #style.lb2, 0, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #style.lb2, 0, 0, _WS_EX_DLGMODALFRAME, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; Resizable Border &lt;/strong&gt; &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #style.lb2, _WS_THICKFRAME, 0, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #style.lb2, _WS_THICKFRAME, 0, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x--Stylebits, Listboxes and Scrollbars&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;Stylebits, Listboxes and Scrollbars&lt;/h3&gt;
&lt;br /&gt;
The default scrollbar lies on the right side of the listbox.  When the listbox is tall enough to contain all the items, this scrollbar shows in the disabled state.  Using the stylebits _WS_HSCROLL, _WS_VSCROLL, _WS_EX_LEFTSCROLLBAR, and _WS_EX_RIGHTSCROLLBAR, you can hide and even reposition the scroll bar.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; Add Horizontal Scrollbar and Remove Vertical Scrollbar &lt;/strong&gt; &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #style.lb1, _WS_HSCROLL, _WS_VSCROLL, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #style.lb1, _WS_HSCROLL, _WS_VSCROLL, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; Add Horizontal Position Scrollbar on Left &lt;/strong&gt; &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #style.lb2, 0, 0, _WS_EX_LEFTSCROLLBAR, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #style.lb2, 0, 0, _WS_EX_LEFTSCROLLBAR, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; Remove Default Disabled Listbar &lt;/strong&gt; &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #style.lb3, 0, _LBS_DISABLENOSCROLL, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #style.lb3, 0, _LBS_DISABLENOSCROLL, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;x--Stylebits, Listboxes and Columns&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;Stylebits, Listboxes and Columns&lt;/h3&gt;
&lt;br /&gt;
The native listbox displays a single, scrolling column.  The stylebits _LB_MULTICOLUMN allows the listbox to display more than one column.  The number of columns is NOT determined by assigning a value.  Rather, the number of columns is determined by the height of the listbox.  Only vertically visible items are assigned to each column.  By carefully controlling the height of the listbox, thus controlling the number of vertically visible listed items, the programmer can control the number of columns.  The width of the column has no effect upon the number of columns.  If not all columns will be visible, assign the stylebits _WS_HSCROLL as well.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; Multicolumn Listbox with a Horizontal Scrollbar &lt;/strong&gt; &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #style.lb3, _LBS_MULTICOLUMN or _WS_HSCROLL, 0,0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #style.lb3, _LBS_MULTICOLUMN &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _WS_HSCROLL, 0,0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:23:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;x--Stylebits, Listboxes and Selection&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:23 --&gt;Stylebits, Listboxes and Selection&lt;/h3&gt;
A selection in the native listbox is chosen by double left - clicking.  This highlights that item.  Only one selection can in the selected state.  That selection is retrieved using either the selection? or the selectionindex? command.  Stylebits allow more than one item to be in the selected state at any given time.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; Multiple Single Selections &lt;/strong&gt; &lt;/em&gt; - String selection is toggled each time the user clicks or double-clicks the string. Any number of strings can be selected.&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;#style.lb2, _LBS_MULTIPLESEL, 0, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;#style.lb2, _LBS_MULTIPLESEL, 0, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; Extended Selection &lt;/strong&gt; &lt;/em&gt; - The user can select multiple items using the SHIFT key and the mouse or special key combinations.  Ctrl - Mouse Click selects multiple single items.  Shift - Mouse Click selects a range of items.&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #style.lb3, _LBS_EXTENDEDSEL, 0, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #style.lb3, _LBS_EXTENDEDSEL, 0, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt; &lt;strong&gt; No Selection &lt;/strong&gt; &lt;/em&gt; - Specifies that the list box contains items that can be viewed but not selected.&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #style.lb1, _LBS_NOSEL, 0, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #style.lb1, _LBS_NOSEL, 0, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:25:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;x--Stylebits and API Calls&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:25 --&gt;Stylebits and API Calls&lt;/h3&gt;
Stylebits do allow multiple and extended selections in listboxes, but an API call (SendMessageA) is required to retrieve those selections.  _LB_SETSEL is used to select one, multiple, or all items.  By changing the state parameter, _LB_SETSEL is also used to clear one, multiple, or all items.  The number of selected items is obtained with _LB_GETSELCOUNT.  Because the Listbox sees the items beginning with 0, it may be necessary to decrement the item number by 1.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;&#039;Setting Multiple Selections and Getting Multiple Selections&amp;lt;br/&amp;gt;&#039;with SendMessageA API calls&amp;lt;br/&amp;gt;&#039;A special Thank You to Bill Beasley for getting this code started&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Dim itemArray$(20)&amp;lt;br/&amp;gt;    For i = 1 to 20&amp;lt;br/&amp;gt;        itemArray$(i) = &amp;amp;quot;Item Number &amp;amp;quot;;Space$(i &amp;amp;lt; 10);Str$(i)&amp;lt;br/&amp;gt;    Next i&amp;lt;br/&amp;gt;    nullParameter = 0 &#039;Used as filler when parameter irrelevant&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    WindowWidth = 400&amp;lt;br/&amp;gt;    WindowHeight = 360&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Listbox #main.lb, itemArray$(), [selectItem], 20, 20, 140, 200&amp;lt;br/&amp;gt;    &#039;_LBS_MULTIPLESEL = Multiple Single Selections using Left Click&amp;lt;br/&amp;gt;    Stylebits #main.lb, _LBS_MULTIPLESEL, 0, 0, 0&amp;lt;br/&amp;gt;    &#039;_LBS_EXTENDEDSEL = Multiple Single Selections using Ctrl - Left Click as well as&amp;lt;br/&amp;gt;    &#039;selection of a range of items using Shift - Left Click&amp;lt;br/&amp;gt;    &#039;Stylebits #main.lb, _LBS_EXTENDEDSEL, 0, 0, 0&amp;lt;br/&amp;gt;    Statictext #main.st, &amp;amp;quot;&amp;amp;quot;, 20, 230, 350, 100&amp;lt;br/&amp;gt;    Button #main.b1, &amp;amp;quot;Count Items Selected&amp;amp;quot;, [nItemsSelected], UL, 190, 40, 170, 32&amp;lt;br/&amp;gt;    Button #main.b2, &amp;amp;quot;List Items Selected&amp;amp;quot;, [listItemsSelected], UL, 190, 85, 170, 32&amp;lt;br/&amp;gt;    Button #main.b3, &amp;amp;quot;Select All Items&amp;amp;quot;, [selectAllItems], UL, 190, 130, 170, 32&amp;lt;br/&amp;gt;    Button #main.b4, &amp;amp;quot;Clear All Items&amp;amp;quot;, [clearAllItems], UL, 190, 175, 170, 32&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Listbox Multi Select&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose [endDemo]&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    hLB = hwnd(#main.lb)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Select some items&amp;lt;br/&amp;gt;    For i = 1 to 20 step 3&amp;lt;br/&amp;gt;        null = SendMessageA(hLB, _LB_SETSEL, 1, i)&amp;lt;br/&amp;gt;    Next i&amp;lt;br/&amp;gt;    #main.st &amp;amp;quot;Every 3rd Item is Selected&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[selectItem]&amp;lt;br/&amp;gt;&#039;No action necessary&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[nItemsSelected]&amp;lt;br/&amp;gt;    nItemsSelected = SendMessageA(hLB, _LB_GETSELCOUNT, nullParameter, nullParameter) &#039;no relevance (par1), (par2)&amp;lt;br/&amp;gt;    #main.st &amp;amp;quot;There are &amp;amp;quot;;nItemsSelected;&amp;amp;quot; items selected.&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[listItemsSelected]&amp;lt;br/&amp;gt;    itemsSel$ = &amp;amp;quot;&amp;amp;quot;&amp;lt;br/&amp;gt;    For i = 1 to 20&amp;lt;br/&amp;gt;        isSel = SendMessageA(hLB, _LB_GETSEL, i - 1, nullParameter) &#039;i - 1 = Item Number (par1), no relevance (par2)&amp;lt;br/&amp;gt;        If isSel Then&amp;lt;br/&amp;gt;            itemsSel$ = itemsSel$;itemArray$(i);&amp;amp;quot;, &amp;amp;quot;&amp;lt;br/&amp;gt;        End If&amp;lt;br/&amp;gt;    Next i&amp;lt;br/&amp;gt;    itemsSel$ = Left$(itemsSel$, Len(itemsSel$) - 2)&amp;lt;br/&amp;gt;    #main.st itemsSel$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[selectAllItems]&amp;lt;br/&amp;gt;    allSel = SendMessageA(hLB, _LB_SETSEL, 1, -1) &#039; 1 (par1) = Flag to Set, -1 (par2) = ALL&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[clearAllItems]&amp;lt;br/&amp;gt;    allClear = SendMessageA(hLB, _LB_SETSEL, 0, -1) &#039;0 (par1) = Flag to Clear, -1 (par2) = ALL&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[endDemo]&amp;lt;br/&amp;gt;    Close #main&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Function SendMessageA(hW, msg, par1, par2)&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;,_&amp;lt;br/&amp;gt;        hW as Ulong, _ &#039;Handle of the control (listbox)&amp;lt;br/&amp;gt;        msg as Long, _ &#039;Stylebits (Windows Constant)&amp;lt;br/&amp;gt;        par1 as Long, _ &#039;Parameter 1 (sometimes irrelevant)&amp;lt;br/&amp;gt;        par2 as Long, _ &#039;Parameter 2 (sometimes irrelevant)&amp;lt;br/&amp;gt;        SendMessageA as long &#039;Return Value, 1 = success&amp;lt;br/&amp;gt;End Function&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Setting Multiple Selections and Getting Multiple Selections
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;with SendMessageA API calls
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;A special Thank You to Bill Beasley for getting this code started
&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Dim&lt;/span&gt; itemArray$(20)
    &lt;span class=&quot;kw3&quot;&gt;For&lt;/span&gt; i = 1 &lt;span class=&quot;kw3&quot;&gt;to&lt;/span&gt; 20
        itemArray$(i) = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Item Number &amp;quot;&lt;/span&gt;;Space$(i &amp;lt; 10);Str$(i)
    &lt;span class=&quot;kw3&quot;&gt;Next&lt;/span&gt; i
    nullParameter = 0 &lt;span class=&quot;co1&quot;&gt;&#039;Used as filler when parameter irrelevant
&lt;/span&gt;
    Nomainwin
    WindowWidth = 400
    WindowHeight = 360
&amp;nbsp;
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
&amp;nbsp;
    Listbox #main.lb, itemArray$(), [selectItem], 20, 20, 140, 200
    &lt;span class=&quot;co1&quot;&gt;&#039;_LBS_MULTIPLESEL = Multiple Single Selections using Left Click
&lt;/span&gt;    Stylebits #main.lb, _LBS_MULTIPLESEL, 0, 0, 0
    &lt;span class=&quot;co1&quot;&gt;&#039;_LBS_EXTENDEDSEL = Multiple Single Selections using Ctrl - Left Click as well as
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;selection of a range of items using Shift - Left Click
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;Stylebits #main.lb, _LBS_EXTENDEDSEL, 0, 0, 0
&lt;/span&gt;    Statictext #main.st, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, 20, 230, 350, 100
    Button #main.b1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Count Items Selected&amp;quot;&lt;/span&gt;, [nItemsSelected], UL, 190, 40, 170, 32
    Button #main.b2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;List Items Selected&amp;quot;&lt;/span&gt;, [listItemsSelected], UL, 190, 85, 170, 32
    Button #main.b3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Select All Items&amp;quot;&lt;/span&gt;, [selectAllItems], UL, 190, 130, 170, 32
    Button #main.b4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Clear All Items&amp;quot;&lt;/span&gt;, [clearAllItems], UL, 190, 175, 170, 32
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Listbox Multi Select&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [endDemo]&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    hLB = hwnd(#main.lb)
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Select some items
&lt;/span&gt;    &lt;span class=&quot;kw3&quot;&gt;For&lt;/span&gt; i = 1 &lt;span class=&quot;kw3&quot;&gt;to&lt;/span&gt; 20 &lt;span class=&quot;kw3&quot;&gt;step&lt;/span&gt; 3
        &lt;span class=&quot;kw5&quot;&gt;null&lt;/span&gt; = SendMessageA(hLB, _LB_SETSEL, 1, i)
    &lt;span class=&quot;kw3&quot;&gt;Next&lt;/span&gt; i
    #main.st &lt;span class=&quot;st0&quot;&gt;&amp;quot;Every 3rd Item is Selected&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Wait
&amp;nbsp;
[selectItem]
&lt;span class=&quot;co1&quot;&gt;&#039;No action necessary
&lt;/span&gt;    Wait
&amp;nbsp;
[nItemsSelected]
    nItemsSelected = SendMessageA(hLB, _LB_GETSELCOUNT, nullParameter, nullParameter) &lt;span class=&quot;co1&quot;&gt;&#039;no relevance (par1), (par2)
&lt;/span&gt;    #main.st &lt;span class=&quot;st0&quot;&gt;&amp;quot;There are &amp;quot;&lt;/span&gt;;nItemsSelected;&lt;span class=&quot;st0&quot;&gt;&amp;quot; items selected.&amp;quot;&lt;/span&gt;
    Wait
&amp;nbsp;
[listItemsSelected]
    itemsSel$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;For&lt;/span&gt; i = 1 &lt;span class=&quot;kw3&quot;&gt;to&lt;/span&gt; 20
        isSel = SendMessageA(hLB, _LB_GETSEL, i - 1, nullParameter) &lt;span class=&quot;co1&quot;&gt;&#039;i - 1 = Item Number (par1), no relevance (par2)
&lt;/span&gt;        &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; isSel &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt;
            itemsSel$ = itemsSel$;itemArray$(i);&lt;span class=&quot;st0&quot;&gt;&amp;quot;, &amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;Next&lt;/span&gt; i
    itemsSel$ = Left$(itemsSel$, Len(itemsSel$) - 2)
    #main.st itemsSel$
    Wait
&amp;nbsp;
[selectAllItems]
    allSel = SendMessageA(hLB, _LB_SETSEL, 1, -1) &lt;span class=&quot;co1&quot;&gt;&#039; 1 (par1) = Flag to Set, -1 (par2) = ALL
&lt;/span&gt;    Wait
&amp;nbsp;
[clearAllItems]
    allClear = SendMessageA(hLB, _LB_SETSEL, 0, -1) &lt;span class=&quot;co1&quot;&gt;&#039;0 (par1) = Flag to Clear, -1 (par2) = ALL
&lt;/span&gt;    Wait
&amp;nbsp;
[endDemo]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Function&lt;/span&gt; SendMessageA(hW, msg, par1, par2)
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;,_
        hW &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Ulong, _ &lt;span class=&quot;co1&quot;&gt;&#039;Handle of the control (listbox)
&lt;/span&gt;        msg &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;Stylebits (Windows Constant)
&lt;/span&gt;        par1 &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;Parameter 1 (sometimes irrelevant)
&lt;/span&gt;        par2 &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _ &lt;span class=&quot;co1&quot;&gt;&#039;Parameter 2 (sometimes irrelevant)
&lt;/span&gt;        SendMessageA &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;Return Value, 1 = success
&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;These are just some examples of what you can do with stylebits and listboxes.  With experimentation, you may find more.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:27:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc7&quot;&gt;&lt;a name=&quot;x--A List of Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:27 --&gt;A List of Stylebits&lt;/h3&gt;
&lt;br /&gt;
You can get a list of all &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632600(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwStyles&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwExStyles&lt;/a&gt; available with the Stylebits command at the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb775149(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;MSDN Library - List Box Styles&lt;/a&gt;.</description>
          </item>
    <item>
      <title>Stylebits - Statictext</title>
      <link>https://lbpe.wikispaces.com/Stylebits+-+Statictext</link>
      <dc:creator>JanetTerra</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/Stylebits+-+Statictext</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/Stylebits+-+Statictext</comments>
      <pubDate>Fri, 27 Aug 2010 02:33:51 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:4:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x-Reviewing the Stylebits Parameters&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:4 --&gt;Reviewing the Stylebits Parameters&lt;/h2&gt;
&lt;br /&gt;
The four parameters of stylebits are AddBit, RemoveBit, AddExtendedBit, RemoveExtendedBit.  For a review of these four parameters, and an introduction to Stylebits in general, please view &lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Windows&quot;&gt;Stylebits - Windows&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:6:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x-Stylebits and Formatted Text&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:6 --&gt;Stylebits and Formatted Text&lt;/h2&gt;
&lt;br /&gt;
Many of the stylebits commands used with windows and textboxes can also be used with statictext controls.  Since statictext doesn&#039;t accept user input, most of the stylebits effects involve text formatting and borders.  Statictext can be justified horizontally using these commands -&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;_SS_LEFT&amp;lt;br/&amp;gt;_SS_CENTER&amp;lt;br/&amp;gt;_SS_RIGHT&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;_SS_LEFT
_SS_CENTER
_SS_RIGHT&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;Statictext can also be centered vertically using the command -&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;_SS_CENTERIMAGE&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;_SS_CENTERIMAGE&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;It is possible to create a nice etched look in your text using the command -&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;_WS_DISABLED&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;_WS_DISABLED&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;Use this strategy with caution, though.  Any control disabled with the stylebits will require an API call to cause the statictext to later become enabled.  The same look can be achieved using the native Liberty BASIC command &lt;strong&gt;!Disable&lt;/strong&gt; and affords the programmer the opportunity to normalize the text look using &lt;strong&gt;!Enable&lt;/strong&gt; later in the code.&lt;br /&gt;
&lt;br /&gt;
There are some very interesting visual effects that can be achieved using a stylebits created border around your statictext.&lt;br /&gt;
&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;Stylebits&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;_WS_DLGFRAME, 0, 0, 0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.....&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;Raised Background&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0, 0, _WS_EX_STATICEDGE, 0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.....&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;Slightly Recessed Background&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0, 0, _WS_EX_CLIENTEDGE, 0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.....&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;Deeper Recessed Background&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0, 0, _WS_EX_STATICEDGE or _WS_EX_CLIENTEDGE, 0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.....&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;Double Recessed Background&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;_WS_BORDER, 0, 0, 0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.....&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;Thin Line Border&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0, 0, _WS_EX_DLGMODALFRAME or _WS_EX_CLIENTEDGE, 0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.....&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;Raised Frame&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;_WS_THICKFRAME, 0, _WS_EX_DLGMODALFRAME or _WS_EX_CLIENTEDGE, 0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.....&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;Double Raised Frame&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:8:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x-Stylebits and Formatted Text-Stylebits and API Calls&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:8 --&gt;Stylebits and API Calls&lt;/h3&gt;
&lt;br /&gt;
Stylebits allow statictext to display images, but only when accompanied by an API call to user32.dll (SendMessageA).  The height and width of the statictext will initially cause a smaller bitmap to stretch and fill the originally defined statictext dimensions.  You can prevent this distortion by either making certain the statictext width and height is the same as the loaded bitmap or using the _SS_CENTERIMAGE stylebits.  Recessed, raised and flat effects can be achieved using window edge stylebits.&lt;br /&gt;
Right - Click and save this bitmap as &amp;quot;boy.bmp&amp;quot; on your computer.  Run the demo from the same folder in which you saved the bitmap.  Once the code is run, maximizing the window will demonstrate how the bitmap stretches to fill the defined statictext area.&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:74:&amp;lt;img src=&amp;quot;/file/view/boy.bmp/239981085/54x100/boy.bmp&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;height: 100px; width: 54px;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/boy.bmp/239981085/54x100/boy.bmp&quot; alt=&quot;boy.bmp&quot; title=&quot;boy.bmp&quot; style=&quot;height: 100px; width: 54px;&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:74 --&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    WindowWidth=600&amp;lt;br/&amp;gt;    WindowHeight=450&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2) - 14&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Loadbmp &amp;amp;quot;boy&amp;amp;quot;, &amp;amp;quot;boy.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #main.st0, &amp;amp;quot;&amp;amp;quot;, 10, 10, 54, 100&amp;lt;br/&amp;gt;    Stylebits #main.st0, _SS_BITMAP, 0, 0, 0&amp;lt;br/&amp;gt;    Statictext #main, &amp;amp;quot;The bitmap boy.bmp 54 x 100.&amp;amp;quot;, 90, 30, 150, 56&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #main.st1, &amp;amp;quot;&amp;amp;quot;, 10, 140, 80, 120&amp;lt;br/&amp;gt;    Stylebits #main.st1, _SS_BITMAP or _WS_BORDER, 0, 0, 0&amp;lt;br/&amp;gt;    Statictext #main, &amp;amp;quot;Thin Line Border, Bitmap expands to fit defined statictext area (80 x 120) when window resized.&amp;amp;quot;, _&amp;lt;br/&amp;gt;        100, 120, 150, 140&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #main.st2, &amp;amp;quot;&amp;amp;quot;, 10, 300, 80, 120&amp;lt;br/&amp;gt;    Stylebits #main.st2, _SS_BITMAP or _WS_BORDER, 0, _WS_EX_STATICEDGE, 0&amp;lt;br/&amp;gt;    Statictext #main, &amp;amp;quot;Etched look with _WS_BORDER and _WS_EX_STATEDGE, also resizes when window resized.&amp;amp;quot;, _&amp;lt;br/&amp;gt;        100, 280, 150, 140&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #main.st3, &amp;amp;quot;&amp;amp;quot;, 480, 70, 100, 150&amp;lt;br/&amp;gt;    Stylebits #main.st3, _SS_BITMAP or _SS_CENTERIMAGE, 0, _WS_EX_CLIENTEDGE, 0&amp;lt;br/&amp;gt;    Statictext #main, &amp;amp;quot;_SS_ CENTERIMAGE prevents resizing when window resized.&amp;amp;quot;, 320, 90, 150, 140&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #main.st4, &amp;amp;quot;&amp;amp;quot;, 480, 250, 100, 150&amp;lt;br/&amp;gt;    Stylebits #main.st4, _SS_BITMAP or _SS_CENTERIMAGE, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Statictext #main, &amp;amp;quot;Borders can be raised, recessed or flat.&amp;amp;quot;, 320, 280, 150, 140&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits for Images on Statictext&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose [closeDemo]&amp;amp;quot;&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Font Times_New_Roman 14 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    hStatic0 = hWnd(#main.st0)&amp;lt;br/&amp;gt;    hStatic1 = hWnd(#main.st1)&amp;lt;br/&amp;gt;    hStatic2 = hWnd(#main.st2)&amp;lt;br/&amp;gt;    hStatic3 = hWnd(#main.st3)&amp;lt;br/&amp;gt;    hStatic4 = hWnd(#main.st4)&amp;lt;br/&amp;gt;    hImage = hBmp(&amp;amp;quot;boy&amp;amp;quot;)&amp;lt;br/&amp;gt;    Call setImage hStatic0, hImage&amp;lt;br/&amp;gt;    Call setImage hStatic1, hImage&amp;lt;br/&amp;gt;    Call setImage hStatic2, hImage&amp;lt;br/&amp;gt;    Call setImage hStatic3, hImage&amp;lt;br/&amp;gt;    Call setImage hStatic4, hImage&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Sub setImage hStatic, hImage&amp;lt;br/&amp;gt;    CallDLL #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;        hStatic as Ulong, _&amp;lt;br/&amp;gt;        _STM_SETIMAGE as Long, _&amp;lt;br/&amp;gt;        _IMAGE_BITMAP as Long, _&amp;lt;br/&amp;gt;        hImage as Ulong, _&amp;lt;br/&amp;gt;        result as Long&amp;lt;br/&amp;gt;    End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[closeDemo]&amp;lt;br/&amp;gt;    Close #main&amp;lt;br/&amp;gt;    Unloadbmp &amp;amp;quot;boy&amp;amp;quot;&amp;lt;br/&amp;gt;    End&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    WindowWidth=600
    WindowHeight=450
&amp;nbsp;
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2) - 14
&amp;nbsp;
    Nomainwin
&amp;nbsp;
    Loadbmp &lt;span class=&quot;st0&quot;&gt;&amp;quot;boy&amp;quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&amp;quot;boy.bmp&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Statictext #main.st0, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, 10, 10, 54, 100
    Stylebits #main.st0, _SS_BITMAP, 0, 0, 0
    Statictext #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;The bitmap boy.bmp 54 x 100.&amp;quot;&lt;/span&gt;, 90, 30, 150, 56
&amp;nbsp;
    Statictext #main.st1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, 10, 140, 80, 120
    Stylebits #main.st1, _SS_BITMAP &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _WS_BORDER, 0, 0, 0
    Statictext #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Thin Line Border, Bitmap expands to fit defined statictext area (80 x 120) when window resized.&amp;quot;&lt;/span&gt;, _
        100, 120, 150, 140
&amp;nbsp;
    Statictext #main.st2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, 10, 300, 80, 120
    Stylebits #main.st2, _SS_BITMAP &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _WS_BORDER, 0, _WS_EX_STATICEDGE, 0
    Statictext #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Etched look with _WS_BORDER and _WS_EX_STATEDGE, also resizes when window resized.&amp;quot;&lt;/span&gt;, _
        100, 280, 150, 140
&amp;nbsp;
    Statictext #main.st3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, 480, 70, 100, 150
    Stylebits #main.st3, _SS_BITMAP &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _SS_CENTERIMAGE, 0, _WS_EX_CLIENTEDGE, 0
    Statictext #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;_SS_ CENTERIMAGE prevents resizing when window resized.&amp;quot;&lt;/span&gt;, 320, 90, 150, 140
&amp;nbsp;
    Statictext #main.st4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, 480, 250, 100, 150
    Stylebits #main.st4, _SS_BITMAP &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _SS_CENTERIMAGE, 0, _WS_EX_DLGMODALFRAME, 0
    Statictext #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Borders can be raised, recessed or flat.&amp;quot;&lt;/span&gt;, 320, 280, 150, 140
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits for Images on Statictext&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemo]&amp;quot;&lt;/span&gt;
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 14 Bold&amp;quot;&lt;/span&gt;
    hStatic0 = hWnd(#main.st0)
    hStatic1 = hWnd(#main.st1)
    hStatic2 = hWnd(#main.st2)
    hStatic3 = hWnd(#main.st3)
    hStatic4 = hWnd(#main.st4)
    hImage = hBmp(&lt;span class=&quot;st0&quot;&gt;&amp;quot;boy&amp;quot;&lt;/span&gt;)
    &lt;span class=&quot;kw2&quot;&gt;Call&lt;/span&gt; setImage hStatic0, hImage
    &lt;span class=&quot;kw2&quot;&gt;Call&lt;/span&gt; setImage hStatic1, hImage
    &lt;span class=&quot;kw2&quot;&gt;Call&lt;/span&gt; setImage hStatic2, hImage
    &lt;span class=&quot;kw2&quot;&gt;Call&lt;/span&gt; setImage hStatic3, hImage
    &lt;span class=&quot;kw2&quot;&gt;Call&lt;/span&gt; setImage hStatic4, hImage
    Wait
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; setImage hStatic, hImage
    CallDLL #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;, _
        hStatic &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Ulong, _
        _STM_SETIMAGE &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        _IMAGE_BITMAP &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
        hImage &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; Ulong, _
        result &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
[closeDemo]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
    Unloadbmp &lt;span class=&quot;st0&quot;&gt;&amp;quot;boy&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;br /&gt;
These are just some examples of what you can do with stylebits and statictext.  With experimentation, you may find more.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:10:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x-Stylebits and Formatted Text-A List of Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:10 --&gt;A List of Stylebits&lt;/h3&gt;
&lt;br /&gt;
You can get a list of all &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632600(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwStyles&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwExStyles&lt;/a&gt; available with the Stylebits command at the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb760773(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;MSDN Library - Static Styles&lt;/a&gt;.</description>
          </item>
    <item>
      <title>Stylebits - Textboxes</title>
      <link>https://lbpe.wikispaces.com/Stylebits+-+Textboxes</link>
      <dc:creator>StPendl</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/Stylebits+-+Textboxes</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/Stylebits+-+Textboxes</comments>
      <pubDate>Sun, 07 Dec 2008 12:12:31 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:16:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x--Reviewing the Stylebits Parameters&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:16 --&gt;Reviewing the Stylebits Parameters&lt;/h3&gt;
&lt;br /&gt;
The four parameters of stylebits are AddBit, RemoveBit, AddExtendedBit, RemoveExtendedBit.  For a review of these four parameters, and an introduction to Stylebits in general, please view &lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Windows&quot;&gt;Stylebits - Windows&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:18:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x--Line Wrapping&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:18 --&gt;Line Wrapping&lt;/h3&gt;
&lt;br /&gt;
&lt;em&gt;How can I get text to wrap in a textbox?&lt;/em&gt;  This question is frequently asked on the Liberty BASIC Forum.  Line wrapping is easily achieved with a few stylebits.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    WindowWidth=200&amp;lt;br/&amp;gt;    WindowHeight=160&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    text1$ = &amp;amp;quot;STYLEBITS allows you to change the style of a Liberty BASIC window or control.&amp;amp;quot;&amp;lt;br/&amp;gt;    text2$ = &amp;amp;quot;Add to or edit this text.&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Textbox #Main.txtbx, 0, 0, 190, 68&amp;lt;br/&amp;gt;    Stylebits #Main.txtbx, _WS_VSCROLL OR _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0&amp;lt;br/&amp;gt;    Statictext #Main, text2$, 5, 80, 190, 30&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;LineWrap for LB&amp;amp;quot; for Window_nf as #Main&amp;lt;br/&amp;gt;    Print #Main, &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #Main, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #Main.txtbx, text1$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub EndDemo handle$&amp;lt;br/&amp;gt;    Close #Main&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Nomainwin
    WindowWidth=200
    WindowHeight=160
&amp;nbsp;
    text1$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;STYLEBITS allows you to change the style of a Liberty BASIC window or control.&amp;quot;&lt;/span&gt;
    text2$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Add to or edit this text.&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Textbox #Main.txtbx, 0, 0, 190, 68
    Stylebits #Main.txtbx, _WS_VSCROLL &lt;span class=&quot;kw3&quot;&gt;OR&lt;/span&gt; _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0
    Statictext #Main, text2$, 5, 80, 190, 30
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;LineWrap for LB&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window_nf &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #Main
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #Main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #Main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #Main.txtbx, text1$
    Wait
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #Main
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;Go ahead and type in your own text.  The text will wrap automatically as you type.  It is possible to begin a new line in this word wrapping textbox, but you must use CTRL-ENTER rather than just ENTER.  If you don&#039;t like scroll bars, then use a resizable textbox.  Substitute the above stylebits command with&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, _WS_THICKFRAME OR_ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, _WS_THICKFRAME OR_ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
and let the user tug and pull the textbox all over the window.  Be careful with this one.  If your user shrinks the textbox and drags it behind another control, the textbox may become irretrievable.  If you choose this effect, you may want to add some resize handling using the Locate and Refresh commands.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:20:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x--Limiting Text Entry&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:20 --&gt;Limiting Text Entry&lt;/h3&gt;
&lt;br /&gt;
You can limit text length by omitting the vertical scroll bar.  Without the ability to scroll, the textbox will only accept what can be visually seen.  By carefully controlling the font size and the height of the textbox, user input can be contained.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    WindowWidth=200&amp;lt;br/&amp;gt;    WindowHeight=160&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    text1$ = &amp;amp;quot;Doc and Sleepy and Grumpy and Sneezy and&amp;amp;quot;&amp;lt;br/&amp;gt;    text2$ = &amp;amp;quot;Can you name the other 3?&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Textbox #main.txtbx, 0, 0, 190, 68&amp;lt;br/&amp;gt;    Stylebits #main.txtbx, _ES_MULTILINE, _ES_AUTOHSCROLL OR _ES_AUTOVSCROLL, 0, 0&amp;lt;br/&amp;gt;    Statictext #main, text2$, 5, 80, 190, 30&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;LineWrap for LB&amp;amp;quot; for Window_nf as #main&amp;lt;br/&amp;gt;    Print #main, &amp;amp;quot;Trapclose EndDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #main, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #main.txtbx, text1$&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub EndDemo handle$&amp;lt;br/&amp;gt;    Close #main&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    WindowWidth=200
    WindowHeight=160
    Nomainwin
&amp;nbsp;
    text1$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Doc and Sleepy and Grumpy and Sneezy and&amp;quot;&lt;/span&gt;
    text2$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Can you name the other 3?&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Textbox #main.txtbx, 0, 0, 190, 68
    Stylebits #main.txtbx, _ES_MULTILINE, _ES_AUTOHSCROLL &lt;span class=&quot;kw3&quot;&gt;OR&lt;/span&gt; _ES_AUTOVSCROLL, 0, 0
    Statictext #main, text2$, 5, 80, 190, 30
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;LineWrap for LB&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window_nf &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose EndDemo&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #main.txtbx, text1$
&amp;nbsp;
    Wait
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; EndDemo handle$
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;By removing the multiline stylebit you can control the length of a single line of text input.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, 0, _ES_AUTOHSCROLL OR _ES_AUTOVSCROLL, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, 0, _ES_AUTOHSCROLL &lt;span class=&quot;kw3&quot;&gt;OR&lt;/span&gt; _ES_AUTOVSCROLL, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;em&gt;The textbox is nice, but I really need a text editor.  What stylebits will add word wrapping to the text editor&lt;/em&gt;?  Unfortunately, the text editor is a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.yahoo.com/group/libertybasic/message/25061&quot; rel=&quot;nofollow&quot;&gt;widget&lt;/a&gt; and widgets do not respond well to stylebits.  If your program requires a word wrapping text editor, consider downloading Alyce Watson&#039;s &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.alycesrestaurant.com/Utilities.htm&quot; rel=&quot;nofollow&quot;&gt;Text Editor by API&lt;/a&gt;.  This API modified textbox works just like a real text editor, it&#039;s compatible with Liberty BASIC v3.x as well as v4.x, and, best of all, like so many of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.alycesrestaurant.com/&quot; rel=&quot;nofollow&quot;&gt;Alyce&#039;s Liberty BASIC contributions&lt;/a&gt;, it&#039;s &lt;strong&gt;free&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:22:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x--Scrolling vs Wrapping&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:22 --&gt;Scrolling vs Wrapping&lt;/h3&gt;
&lt;br /&gt;
It isn&#039;t always desirable to wrap text.  If you anticipate text will extend beyond the limits of your textbox but you still want to keep the text on one line, consider adding a horizontal scroll bar.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, _WS_HSCROLL, 0, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, _WS_HSCROLL, 0, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:24:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;x--Textbox Borders&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:24 --&gt;Textbox Borders&lt;/h3&gt;
&lt;br /&gt;
Textbox borders respond to window style (_WS_) stylebits, but may require unique combinations.  While&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.gb, 0, _WS_BORDER, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.gb, 0, _WS_BORDER, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;will remove the border of a graphic box, the same effect with a textbox can only be achieved with the removal of an extended style:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, 0, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, 0, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;Thanks to &lt;br /&gt;
&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://libertybasic.conforums.com/index.cgi?board=novice&amp;amp;action=display&amp;amp;num=1109874168&amp;amp;Reply=3&quot; rel=&quot;nofollow&quot;&gt;Mike Bradbury (See Reply #3)&lt;/a&gt; for posting this solution for removing the textbox border.&lt;br /&gt;
&lt;br /&gt;
How about adding a horizontal scroll bar and removing the border?  Here&#039;s a different look.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, _WS_HSCROLL, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, _WS_HSCROLL, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;Rather than removing a border, stylebits might be used to draw a more defined border, giving a distinct 3 - D effect.  _WS_EX_DLGMODALFRAME draws a raised border&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, 0, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, 0, 0, _WS_EX_DLGMODALFRAME, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;while _WS_EX_STATICEDGE draws a &amp;quot;step into&amp;quot; sunken border&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, 0, 0, _WS_EX_STATICEDGE, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, 0, 0, _WS_EX_STATICEDGE, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:26:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;x--Restricting User Input&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:26 --&gt;Restricting User Input&lt;/h3&gt;
&lt;br /&gt;
Edit style (_ES_) stylebits can be used to restrict or modify user input.  &lt;br /&gt;
&lt;br /&gt;
Some examples include&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Numbers Only (Unfortunately, commas and periods are not accepted.  Forget about using this style if decimals are involved.)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, _ES_NUMBER, 0, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, _ES_NUMBER, 0, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Password (The asterisk is the default.  This character can be changed by using the SetPasswordChar function.  Note that _ES_MULTILINE must be included as a RemoveBit parameter.)&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, _ES_PASSWORD, _ES_MULTILINE, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, _ES_PASSWORD, _ES_MULTILINE, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;&lt;ul&gt;&lt;li&gt;Uppercase / Lowercase (Converts all user input to uppercase / lowercase.)&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, _ES_UPPERCASE, 0, 0, 0&amp;lt;br/&amp;gt;Stylebits #main.txtbx, _ES_LOWERCASE, 0, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, _ES_UPPERCASE, 0, 0, 0
Stylebits #main.txtbx, _ES_LOWERCASE, 0, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;&lt;ul&gt;&lt;li&gt;Left / Center / Right Justify (Can be used in either single line textboxes or multiline textboxes.)&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:13:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, _ES_LEFT, 0, 0, 0&amp;lt;br/&amp;gt;Stylebits #main.txtbx, _ES_CENTER, _ES_MULTILINE, 0, 0&amp;lt;br/&amp;gt;Stylebits #main.txtbx, _ES_RIGHT, 0, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, _ES_LEFT, 0, 0, 0
Stylebits #main.txtbx, _ES_CENTER, _ES_MULTILINE, 0, 0
Stylebits #main.txtbx, _ES_RIGHT, 0, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:13 --&gt;&lt;ul&gt;&lt;li&gt;Read Only (Will not accept user input.  Issuing a Disable command later in the program will &#039;gray out&#039; any text in the textbox, but Enable will not reverse the _ES_READONLY style.)&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:14:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Stylebits #main.txtbx, _ES_READONLY, 0, 0, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;Stylebits #main.txtbx, _ES_READONLY, 0, 0, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:14 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:28:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;x--Demo: Borders, Line Wrapping and Textbox Entry&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:28 --&gt;Demo: Borders, Line Wrapping and Textbox Entry&lt;/h3&gt;
&lt;!-- ws:start:WikiTextCodeRule:15:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    &#039; There is no error catching here to prevent a&amp;lt;br/&amp;gt;    &#039; crash if more than one demo window is&amp;lt;br/&amp;gt;    &#039; opened at a time.  Please be sure to close&amp;lt;br/&amp;gt;    &#039; the demo window before opening a new one.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    WindowWidth=400&amp;lt;br/&amp;gt;    WindowHeight=400&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2) - 14&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    text$ = &amp;amp;quot;No stylebits have been added to this textbox.&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Textbox #main.txtbx1, 22, 40, 300, 32&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #main, &amp;amp;quot;_Border Styles_&amp;amp;quot;, 38, 100, 130, 20&amp;lt;br/&amp;gt;    Button #main.style1, &amp;amp;quot;Add H Scroll Bar&amp;amp;quot;, [style1], UL, 30, 130, 130, 32&amp;lt;br/&amp;gt;    Button #main.style2, &amp;amp;quot;Borderless&amp;amp;quot;, [style2], UL, 30, 170, 130, 32&amp;lt;br/&amp;gt;    Button #main.style3, &amp;amp;quot;Blend in Window&amp;amp;quot;, [style3], UL, 30, 210, 130, 32&amp;lt;br/&amp;gt;    Button #main.style4, &amp;amp;quot;Raised Border&amp;amp;quot;, [style4], UL, 30, 250, 130, 32&amp;lt;br/&amp;gt;    Button #main.style5, &amp;amp;quot;SunkenBorder&amp;amp;quot;, [style5], UL, 30, 290, 130, 32&amp;lt;br/&amp;gt;    Button #main.style6, &amp;amp;quot;Resizable Border&amp;amp;quot;, [style6], UL, 30, 330, 130, 32&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #main, &amp;amp;quot;_Text Entry_&amp;amp;quot;, 218, 100, 130, 20&amp;lt;br/&amp;gt;    Button #main.entry1, &amp;amp;quot;Line Wrap 1&amp;amp;quot;, [entry1], UL, 200, 130, 130, 32&amp;lt;br/&amp;gt;    Button #main.entry2, &amp;amp;quot;Line Wrap 2&amp;amp;quot;, [entry2], UL, 200, 170, 130, 32&amp;lt;br/&amp;gt;    Button #main.entry3, &amp;amp;quot;Numbers Only&amp;amp;quot;, [entry3], UL, 200, 210, 130, 32&amp;lt;br/&amp;gt;    Button #main.entry4, &amp;amp;quot;Read Only&amp;amp;quot;, [entry4], UL, 200, 250, 130, 32&amp;lt;br/&amp;gt;    Button #main.entry5, &amp;amp;quot;Upper Case&amp;amp;quot;, [entry5], UL, 200, 290, 130, 32&amp;lt;br/&amp;gt;    Button #main.entry6, &amp;amp;quot;Stay Selected&amp;amp;quot;, [entry6], UL, 200, 330, 130, 32&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits Demo&amp;amp;quot; for Window_nf as #main&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    #main, &amp;amp;quot;Trapclose [endDemo]&amp;amp;quot;&amp;lt;br/&amp;gt;    #main, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.txtbx1, text$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[endDemo]&amp;lt;br/&amp;gt;    Close #main&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[style1] &#039;Horizontal Scroll&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w.tb, _WS_HSCROLL, 0, 0, 0&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #w.tb, _WS_HSCROLL, 0, 0, 0&amp;lt;br/&amp;gt;    Textbox #w.tb, 22, 40, 200, 48&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;Stylebits #w.tb, _WS_HSCROLL, 0, 0, 0&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;This textbox has no line wrapping, but user can scroll to end.&amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;  Be sure to allow extra height to accomodate the Horizontal Scroll Bar.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Horizontal Scroll&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb, textBx$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[style2] &#039;Borderless&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w.tb, 0, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #w.tb, 0, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;lt;br/&amp;gt;    Textbox #w.tb, 22, 40, 300, 32&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;0, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;Both _WS_BORDER and _WS_EX_CLIENTEDGE bits &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;must be removed.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Borderless&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb, textBx$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[style3] &#039;Blend in Window&amp;lt;br/&amp;gt;    TextboxColor$ = &amp;amp;quot;Buttonface&amp;amp;quot;&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w.tb, _WS_HSCROLL, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #w.tb, _WS_HSCROLL, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;lt;br/&amp;gt;    Textbox #w.tb, 22, 40, 300, 48&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;_WS_HSCROLL, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;By changing the TextboxColor$ to Buttonface, and removing &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;the borders, the textbox appears to blend into the window.  Add the Horizontal &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;Scroll Bar with the _WS_HSCROLL stylebit.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Blend in Window&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb, textBx$&amp;lt;br/&amp;gt;    TextboxColor$ = &amp;amp;quot;White&amp;amp;quot; &#039;Reset to white for next display&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[style4] &#039;Raised Border&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w, 0, 0, _WS_EX_DLGMODALFRAME, 0&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #w.tb, 0, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Textbox #w.tb, 22, 40, 300, 32&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;0, 0, _WS_EX_DLGMODALFRAME, 0&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;The textbox has a raised double border.  This &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;raised double border cannot be resized by the user.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Raised Border&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb, textBx$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[style5] &#039;Sunken Border&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w, 0, 0, _WS_EX_STATICEDGE, 0&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #w.tb, 0, 0, _WS_EX_STATICEDGE, 0&amp;lt;br/&amp;gt;    Textbox #w.tb, 22, 40, 300, 32&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;0, 0, _WS_EX_STATICEDGE, 0&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;The textbox has a sunken double border.  This &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;gives a crisp 3 - D appearance of increased depth.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Sunken Border&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb, textBx$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[style6] &#039;Resizable Border&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w, _WS_THICKFRAME, 0, 0, 0&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #w.tb, _WS_THICKFRAME, 0, 0, 0&amp;lt;br/&amp;gt;    Textbox #w.tb, 22, 40, 300, 32&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;_WS_THICKFRAME, 0, 0, 0&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;The textbox has a raised double border.  This &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;raised double border can be resized by the user.  The native LB &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;commands LOCATE and REFRESH can be used to resize after &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;the window is opened.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Raised Border&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb, textBx$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[entry1] &#039;Line Wrap w/ Vertical Scroll Bar&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w.tb, _WS_VSCROLL OR _ES_MULTINE, _ES_AUTOHSCROLL, 0, 0&amp;amp;quot;&amp;lt;br/&amp;gt;    Stylebits #w.tb, _WS_VSCROLL OR_ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0&amp;lt;br/&amp;gt;    Textbox #w.tb, 22, 40, 300, 50&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;_WS_VSCROLL OR _ES_MULTINE, _ES_AUTOHSCROLL, 0, 0&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;To cause a carriage return, you must press CTRL-RETURN.  Try it.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Line Wrap w/ Vertical Scroll Bar&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb, textBx$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[entry2] &#039;Line Wrap w/ Resizable Frame&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w.tb, _THICKFRAME OR _ES_MULTINE, _ES_AUTOHSCROLL, 0, 0&amp;amp;quot;&amp;lt;br/&amp;gt;    Stylebits #w.tb, _WS_THICKFRAME OR_ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0&amp;lt;br/&amp;gt;    Textbox #w.tb, 22, 40, 280, 50&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;_WS_THICKFRAME OR _ES_MULTINE, _ES_AUTOHSCROLL, 0, 0&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;This textbox can be resized to show as little or as much text as &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;desired.  To cause a carriage return, you must press CTRL-RETURN.  Try it.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Line Wrap w/ Resizable Frame&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb, textBx$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[entry3] &#039;Numbers Only&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w, _ES_NUMBER, 0, 0, 0&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #w.tb, _ES_NUMBER, 0, 0, 0&amp;lt;br/&amp;gt;    Textbox #w.tb, 22, 40, 300, 32&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;_ES_NUMBER, 0, 0, 0&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;Although any characters may be printed to this textbox &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;within the program, the textbox will only accept numerical user input. &amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);&amp;amp;quot;Delete what&#039;s in the textbox and try to enter numerical and &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;non - numerical characters.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Numbers Only&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb, textBx$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[entry4] &#039;Read Only&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w, _ES_READONLY, 0, 0, 0&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #w.tb, _ES_READONLY, 0, 0, 0&amp;lt;br/&amp;gt;    Textbox #w.tb, 22, 40, 300, 32&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;_ES_READONLY, 0, 0, 0&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;Although any characters may be printed to this textbox &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;within the program, the textbox will not accept user input.  Unlike the native &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;Liberty BASIC DISABLE command, the textbox does not become &#039;grayed  &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;out.  Try to change the text.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Read Only&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb, textBx$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[entry5] &#039;Uppercase&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w, _ES_UPPERCASE, 0, 0, 0&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #w.tb, _ES_UPPERCASE, 0, 0, 0&amp;lt;br/&amp;gt;    Textbox #w.tb, 22, 40, 300, 32&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;_ES_UPPERCASE, 0, 0, 0&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;Any character typed by the user will be printed in the &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;uppercase form.&amp;amp;quot;;Chr$(13);Chr$(13);&amp;amp;quot;_ES_LOWERCASE works in the same way.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Uppercase&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb, textBx$&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[entry6] &#039;Stay Selected&amp;lt;br/&amp;gt;    textBx$ = &amp;amp;quot;Stylebits #w, _ES_NOHIDESEL 0, 0, 0&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #w.tb1, _ES_NOHIDESEL, 0, 0, 0&amp;lt;br/&amp;gt;    Textbox #w.tb1, 22, 40, 300, 32&amp;lt;br/&amp;gt;    Textbox #w.tb2, 22, 80, 300, 32&amp;lt;br/&amp;gt;    staticTxt$ = &amp;amp;quot;_ES_NOHIDESEL, 0, 0, 0&amp;amp;quot; + _&amp;lt;br/&amp;gt;        Chr$(13);Chr$(13);&amp;amp;quot;The highlighted text in the upper text box remains &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;selected even when focus shifts to another control.&amp;amp;quot;;Chr$(13);Chr$(13) + _&amp;lt;br/&amp;gt;        &amp;amp;quot;The user can override the selection unless the _ES_READONLY &amp;amp;quot; + _&amp;lt;br/&amp;gt;        &amp;amp;quot;stylebit is also applied.&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #w, staticTxt$, 30, 140, 300, 154&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits: Stay Selected&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    #w, &amp;amp;quot;Trapclose [closeDemoWin]&amp;amp;quot;&amp;lt;br/&amp;gt;    #w.tb1, textBx$&amp;lt;br/&amp;gt;    #w.tb1, &amp;amp;quot;!Selectall&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[closeDemoWin]&amp;lt;br/&amp;gt;    Close #w&amp;lt;br/&amp;gt;    Wait&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    &lt;span class=&quot;co1&quot;&gt;&#039; There is no error catching here to prevent a
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039; crash if more than one demo window is
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039; opened at a time.  Please be sure to close
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039; the demo window before opening a new one.
&lt;/span&gt;
    WindowWidth=400
    WindowHeight=400
&amp;nbsp;
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2) - 14
&amp;nbsp;
    Nomainwin
    text$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;No stylebits have been added to this textbox.&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Textbox #main.txtbx1, 22, 40, 300, 32
&amp;nbsp;
    Statictext #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;_Border Styles_&amp;quot;&lt;/span&gt;, 38, 100, 130, 20
    Button #main.style1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Add H Scroll Bar&amp;quot;&lt;/span&gt;, [style1], UL, 30, 130, 130, 32
    Button #main.style2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Borderless&amp;quot;&lt;/span&gt;, [style2], UL, 30, 170, 130, 32
    Button #main.style3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Blend in Window&amp;quot;&lt;/span&gt;, [style3], UL, 30, 210, 130, 32
    Button #main.style4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Raised Border&amp;quot;&lt;/span&gt;, [style4], UL, 30, 250, 130, 32
    Button #main.style5, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SunkenBorder&amp;quot;&lt;/span&gt;, [style5], UL, 30, 290, 130, 32
    Button #main.style6, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Resizable Border&amp;quot;&lt;/span&gt;, [style6], UL, 30, 330, 130, 32
&amp;nbsp;
    Statictext #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;_Text Entry_&amp;quot;&lt;/span&gt;, 218, 100, 130, 20
    Button #main.entry1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Line Wrap 1&amp;quot;&lt;/span&gt;, [entry1], UL, 200, 130, 130, 32
    Button #main.entry2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Line Wrap 2&amp;quot;&lt;/span&gt;, [entry2], UL, 200, 170, 130, 32
    Button #main.entry3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Numbers Only&amp;quot;&lt;/span&gt;, [entry3], UL, 200, 210, 130, 32
    Button #main.entry4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Read Only&amp;quot;&lt;/span&gt;, [entry4], UL, 200, 250, 130, 32
    Button #main.entry5, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Upper Case&amp;quot;&lt;/span&gt;, [entry5], UL, 200, 290, 130, 32
    Button #main.entry6, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stay Selected&amp;quot;&lt;/span&gt;, [entry6], UL, 200, 330, 130, 32
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits Demo&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window_nf &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
&amp;nbsp;
    #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [endDemo]&amp;quot;&lt;/span&gt;
    #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #main.txtbx1, text$
    Wait
&amp;nbsp;
[endDemo]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
&amp;nbsp;
[style1] &lt;span class=&quot;co1&quot;&gt;&#039;Horizontal Scroll
&lt;/span&gt;    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w.tb, _WS_HSCROLL, 0, 0, 0&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Stylebits #w.tb, _WS_HSCROLL, 0, 0, 0
    Textbox #w.tb, 22, 40, 200, 48
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w.tb, _WS_HSCROLL, 0, 0, 0&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;This textbox has no line wrapping, but user can scroll to end.&amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;  Be sure to allow extra height to accomodate the Horizontal Scroll Bar.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Horizontal Scroll&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb, textBx$
    Wait
&amp;nbsp;
[style2] &lt;span class=&quot;co1&quot;&gt;&#039;Borderless
&lt;/span&gt;    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w.tb, 0, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Stylebits #w.tb, 0, _WS_BORDER, 0, _WS_EX_CLIENTEDGE
    Textbox #w.tb, 22, 40, 300, 32
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;0, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;Both _WS_BORDER and _WS_EX_CLIENTEDGE bits &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;must be removed.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Borderless&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb, textBx$
    Wait
&amp;nbsp;
[style3] &lt;span class=&quot;co1&quot;&gt;&#039;Blend in Window
&lt;/span&gt;    TextboxColor$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Buttonface&amp;quot;&lt;/span&gt;
    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w.tb, _WS_HSCROLL, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Stylebits #w.tb, _WS_HSCROLL, _WS_BORDER, 0, _WS_EX_CLIENTEDGE
    Textbox #w.tb, 22, 40, 300, 48
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;_WS_HSCROLL, _WS_BORDER, 0, _WS_EX_CLIENTEDGE&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;By changing the TextboxColor$ to Buttonface, and removing &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;the borders, the textbox appears to blend into the window.  Add the Horizontal &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;Scroll Bar with the _WS_HSCROLL stylebit.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Blend in Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb, textBx$
    TextboxColor$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;White&amp;quot;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039;Reset to white for next display
&lt;/span&gt;    Wait
&amp;nbsp;
[style4] &lt;span class=&quot;co1&quot;&gt;&#039;Raised Border
&lt;/span&gt;    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w, 0, 0, _WS_EX_DLGMODALFRAME, 0&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Stylebits #w.tb, 0, 0, _WS_EX_DLGMODALFRAME, 0
    Textbox #w.tb, 22, 40, 300, 32
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;0, 0, _WS_EX_DLGMODALFRAME, 0&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;The textbox has a raised double border.  This &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;raised double border cannot be resized by the user.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Raised Border&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb, textBx$
    Wait
&amp;nbsp;
[style5] &lt;span class=&quot;co1&quot;&gt;&#039;Sunken Border
&lt;/span&gt;    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w, 0, 0, _WS_EX_STATICEDGE, 0&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Stylebits #w.tb, 0, 0, _WS_EX_STATICEDGE, 0
    Textbox #w.tb, 22, 40, 300, 32
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;0, 0, _WS_EX_STATICEDGE, 0&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;The textbox has a sunken double border.  This &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;gives a crisp 3 - D appearance of increased depth.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Sunken Border&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb, textBx$
    Wait
&amp;nbsp;
[style6] &lt;span class=&quot;co1&quot;&gt;&#039;Resizable Border
&lt;/span&gt;    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w, _WS_THICKFRAME, 0, 0, 0&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Stylebits #w.tb, _WS_THICKFRAME, 0, 0, 0
    Textbox #w.tb, 22, 40, 300, 32
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;_WS_THICKFRAME, 0, 0, 0&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;The textbox has a raised double border.  This &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;raised double border can be resized by the user.  The native LB &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;commands LOCATE and REFRESH can be used to resize after &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;the window is opened.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Raised Border&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb, textBx$
    Wait
&amp;nbsp;
[entry1] &lt;span class=&quot;co1&quot;&gt;&#039;Line Wrap w/ Vertical Scroll Bar
&lt;/span&gt;    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w.tb, _WS_VSCROLL OR _ES_MULTINE, _ES_AUTOHSCROLL, 0, 0&amp;quot;&lt;/span&gt;
    Stylebits #w.tb, _WS_VSCROLL OR_ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0
    Textbox #w.tb, 22, 40, 300, 50
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;_WS_VSCROLL OR _ES_MULTINE, _ES_AUTOHSCROLL, 0, 0&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;To cause a carriage return, you must press CTRL-RETURN.  Try it.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Line Wrap w/ Vertical Scroll Bar&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb, textBx$
    Wait
&amp;nbsp;
[entry2] &lt;span class=&quot;co1&quot;&gt;&#039;Line Wrap w/ Resizable Frame
&lt;/span&gt;    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w.tb, _THICKFRAME OR _ES_MULTINE, _ES_AUTOHSCROLL, 0, 0&amp;quot;&lt;/span&gt;
    Stylebits #w.tb, _WS_THICKFRAME OR_ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0
    Textbox #w.tb, 22, 40, 280, 50
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;_WS_THICKFRAME OR _ES_MULTINE, _ES_AUTOHSCROLL, 0, 0&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;This textbox can be resized to show as little or as much text as &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;desired.  To cause a carriage return, you must press CTRL-RETURN.  Try it.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Line Wrap w/ Resizable Frame&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb, textBx$
    Wait
&amp;nbsp;
[entry3] &lt;span class=&quot;co1&quot;&gt;&#039;Numbers Only
&lt;/span&gt;    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w, _ES_NUMBER, 0, 0, 0&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Stylebits #w.tb, _ES_NUMBER, 0, 0, 0
    Textbox #w.tb, 22, 40, 300, 32
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;_ES_NUMBER, 0, 0, 0&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;Although any characters may be printed to this textbox &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;within the program, the textbox will only accept numerical user input. &amp;quot;&lt;/span&gt; + _
        Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;Delete what&#039;s in the textbox and try to enter numerical and &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;non - numerical characters.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Numbers Only&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb, textBx$
    Wait
&amp;nbsp;
[entry4] &lt;span class=&quot;co1&quot;&gt;&#039;Read Only
&lt;/span&gt;    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w, _ES_READONLY, 0, 0, 0&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Stylebits #w.tb, _ES_READONLY, 0, 0, 0
    Textbox #w.tb, 22, 40, 300, 32
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;_ES_READONLY, 0, 0, 0&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;Although any characters may be printed to this textbox &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;within the program, the textbox will not accept user input.  Unlike the native &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;Liberty BASIC DISABLE command, the textbox does not become &#039;grayed  &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;out.  Try to change the text.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Read Only&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb, textBx$
    Wait
&amp;nbsp;
&amp;nbsp;
[entry5] &lt;span class=&quot;co1&quot;&gt;&#039;Uppercase
&lt;/span&gt;    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w, _ES_UPPERCASE, 0, 0, 0&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Stylebits #w.tb, _ES_UPPERCASE, 0, 0, 0
    Textbox #w.tb, 22, 40, 300, 32
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;_ES_UPPERCASE, 0, 0, 0&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;Any character typed by the user will be printed in the &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;uppercase form.&amp;quot;&lt;/span&gt;;Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;_ES_LOWERCASE works in the same way.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Uppercase&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb, textBx$
    Wait
&amp;nbsp;
[entry6] &lt;span class=&quot;co1&quot;&gt;&#039;Stay Selected
&lt;/span&gt;    textBx$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #w, _ES_NOHIDESEL 0, 0, 0&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Stylebits #w.tb1, _ES_NOHIDESEL, 0, 0, 0
    Textbox #w.tb1, 22, 40, 300, 32
    Textbox #w.tb2, 22, 80, 300, 32
    staticTxt$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;_ES_NOHIDESEL, 0, 0, 0&amp;quot;&lt;/span&gt; + _
        Chr$(13);Chr$(13);&lt;span class=&quot;st0&quot;&gt;&amp;quot;The highlighted text in the upper text box remains &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;selected even when focus shifts to another control.&amp;quot;&lt;/span&gt;;Chr$(13);Chr$(13) + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;The user can override the selection unless the _ES_READONLY &amp;quot;&lt;/span&gt; + _
        &lt;span class=&quot;st0&quot;&gt;&amp;quot;stylebit is also applied.&amp;quot;&lt;/span&gt;
    Statictext #w, staticTxt$, 30, 140, 300, 154
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: Stay Selected&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    #w, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeDemoWin]&amp;quot;&lt;/span&gt;
    #w.tb1, textBx$
    #w.tb1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;!Selectall&amp;quot;&lt;/span&gt;
    Wait
&amp;nbsp;
[closeDemoWin]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #w
    Wait&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:15 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:30:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc7&quot;&gt;&lt;a name=&quot;x--Other Stylebits with Textboxes&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:30 --&gt;Other Stylebits with Textboxes&lt;/h3&gt;
&lt;br /&gt;
The best way to see how textboxes can be altered with Stylebits is to experiment.  You may well find that other combinations will create additional display and editing styles.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:32:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc8&quot;&gt;&lt;a name=&quot;x--A List of Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:32 --&gt;A List of Stylebits&lt;/h3&gt;
&lt;br /&gt;
You can get a list of all &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632600(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwStyles&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwExStyles&lt;/a&gt; available with the Stylebits command at the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb775464(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;MSDN Library - Edit Styles&lt;/a&gt;.</description>
          </item>
    <item>
      <title>Stylebits - Toggle Buttons</title>
      <link>https://lbpe.wikispaces.com/Stylebits+-+Toggle+Buttons</link>
      <dc:creator>JanetTerra</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/Stylebits+-+Toggle+Buttons</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/Stylebits+-+Toggle+Buttons</comments>
      <pubDate>Fri, 27 Aug 2010 02:17:04 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:3:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x--The PUSHLIKE Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:3 --&gt;The PUSHLIKE Stylebits&lt;/h3&gt;
&lt;br /&gt;
Stylebits allows checkboxes and radiobuttons to appear to be pushed rather than selected.  Stefan Pendl, always generous with explanations and code, offered button information in response to a query posed at the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.yahoo.com/group/libertybasic/&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC yahoo! message group&lt;/a&gt;.  (See the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.yahoo.com/group/libertybasic/message/27196&quot; rel=&quot;nofollow&quot;&gt;original message #27196&lt;/a&gt;.)&lt;br /&gt;
&lt;br /&gt;
For a better understanding, the following controls are all defined as buttons by Windows:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;button&lt;/li&gt;&lt;li&gt;groupbox&lt;/li&gt;&lt;li&gt;bmpbutton&lt;/li&gt;&lt;li&gt;checkbox&lt;/li&gt;&lt;li&gt;radiobutton&lt;/li&gt;&lt;/ol&gt;You can use the style _BS_PUSHLIKE to change the radiobutton and checkbox into a pushbutton, that will keep its state.&lt;br /&gt;
&lt;br /&gt;
These buttons are called toggle buttons, they are raised when inactive and sunken when active.  To find out more about toggle buttons, read the information at the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb775951(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;MSDN Library&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x--Stefan&#039;s Demo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;Stefan&#039;s Demo&lt;/h3&gt;
Stefan was kind enough to grant permission for his yahoo! code to be republished here.  Using the _BS_PUSHLIKE stylebits, a checkbox and two grouped radiobuttons are altered from their usual forms to button forms.  The change in style does not alter the set and unset properties.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    groupbox #main.gb, &amp;amp;quot;Toggle Radiobuttons&amp;amp;quot;, 10, 10, 120, 100&amp;lt;br/&amp;gt;    stylebits #main.bt, _BS_PUSHLIKE, 0, 0, 0&amp;lt;br/&amp;gt;    radiobutton #main.bt, &amp;amp;quot;Toggle&amp;amp;quot;, [pushed], [pushed], 20, 30, 100, 30&amp;lt;br/&amp;gt;    stylebits #main.bt1, _BS_PUSHLIKE, 0, 0, 0&amp;lt;br/&amp;gt;    radiobutton #main.bt1, &amp;amp;quot;Toggle1&amp;amp;quot;, [pushed], [pushed], 20, 70, 100, 30&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    stylebits #main.bt2, _BS_PUSHLIKE, 0, 0, 0&amp;lt;br/&amp;gt;    checkbox #main.bt2, &amp;amp;quot;Toggle Checkbox&amp;amp;quot;, [pushed], [pushed], 20, 120, 100, 30&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    open &amp;amp;quot;Toggle demo&amp;amp;quot; for window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;trapclose [quit]&amp;amp;quot;&amp;lt;br/&amp;gt;    wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[pushed]&amp;lt;br/&amp;gt;    wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[quit]&amp;lt;br/&amp;gt;    close #main&amp;lt;br/&amp;gt;    end&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    nomainwin
&amp;nbsp;
    groupbox #main.gb, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Toggle Radiobuttons&amp;quot;&lt;/span&gt;, 10, 10, 120, 100
    stylebits #main.bt, _BS_PUSHLIKE, 0, 0, 0
    radiobutton #main.bt, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Toggle&amp;quot;&lt;/span&gt;, [pushed], [pushed], 20, 30, 100, 30
    stylebits #main.bt1, _BS_PUSHLIKE, 0, 0, 0
    radiobutton #main.bt1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Toggle1&amp;quot;&lt;/span&gt;, [pushed], [pushed], 20, 70, 100, 30
&amp;nbsp;
    stylebits #main.bt2, _BS_PUSHLIKE, 0, 0, 0
    checkbox #main.bt2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Toggle Checkbox&amp;quot;&lt;/span&gt;, [pushed], [pushed], 20, 120, 100, 30
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Toggle demo&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;trapclose [quit]&amp;quot;&lt;/span&gt;
    wait
&amp;nbsp;
[pushed]
    wait
&amp;nbsp;
[quit]
    &lt;span class=&quot;kw3&quot;&gt;close&lt;/span&gt; #main
    &lt;span class=&quot;kw3&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x--Stylebits, Graphics and the API call, &amp;quot;SendMessageA&amp;quot;&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;Stylebits, Graphics and the API call, &amp;quot;SendMessageA&amp;quot;&lt;/h3&gt;
&lt;br /&gt;
Creating graphic buttons using _BS_BITMAP and CallDLL #user32, &amp;quot;SendMessageA&amp;quot; has been discussed by Alyce Watson in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://babek.info/libertybasicfiles/lbnews/nl123/api.htm&quot; rel=&quot;nofollow&quot;&gt;API Corner - Easy BMP Buttons (LB Newsletter #123)&lt;/a&gt; and also in &lt;a class=&quot;wiki_link&quot; href=&quot;/Stylebits%20-%20Buttons&quot;&gt;Stylebits - Buttons&lt;/a&gt;.  In these next two demos, the graphics are drawn and captured within the program.  You could easily substitute your own code for loading the bitmaps from file.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;&#039;Demonstration of using Stylebits to turn checkboxes into&amp;lt;br/&amp;gt;&#039;push buttons&amp;lt;br/&amp;gt;&#039;Based on code provided by Stefan Pendl&amp;lt;br/&amp;gt;&#039;Yahoo! Message ##27196&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    WindowWidth = 207&amp;lt;br/&amp;gt;    WindowHeight = 297&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Groupbox defines Checkbox Area&amp;lt;br/&amp;gt;    Groupbox #main.gp, &amp;amp;quot;Color&amp;amp;quot;, 10, 10, 120, 100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Draw checkboxes that will look like push buttons&amp;lt;br/&amp;gt;&#039;Stylebits _BS_PUSHLIKE causes checkbox to resemble push button&amp;lt;br/&amp;gt;&#039;Stylebits _BS_BITMAP allows a bitmap to be drawn on button&amp;lt;br/&amp;gt;&#039;Be sure to set width and height to bitmap dimensions&amp;lt;br/&amp;gt;    Stylebits #main.bt1, _BS_PUSHLIKE or _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Checkbox #main.bt1, &amp;amp;quot;&amp;amp;quot;, checked, unchecked, 20, 30, 40, 30&amp;lt;br/&amp;gt;    Stylebits #main.bt2, _BS_PUSHLIKE or _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Checkbox #main.bt2, &amp;amp;quot;&amp;amp;quot;, checked, unchecked, 20, 70, 40, 30&amp;lt;br/&amp;gt;    Stylebits #main.bt3, _BS_PUSHLIKE or _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Checkbox #main.bt3, &amp;amp;quot;&amp;amp;quot;, checked, unchecked, 80, 30, 40, 30&amp;lt;br/&amp;gt;    Stylebits #main.bt4, _BS_PUSHLIKE or _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Checkbox #main.bt4, &amp;amp;quot;&amp;amp;quot;, checked, unchecked, 80, 70, 40, 30&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;For this demo, a graphicbox is needed to draw and capture bitmaps&amp;lt;br/&amp;gt;    Graphicbox #main.gb, 0, 150, 200, 120&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits and Checkboxes&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose endDemo&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Obtain handle of the main window&amp;lt;br/&amp;gt;    hMain = hWnd(#main)&amp;lt;br/&amp;gt;&#039;Obtain handles of the 4 checkboxes&amp;lt;br/&amp;gt;    hButton1 = hWnd(#main.bt1)&amp;lt;br/&amp;gt;    hButton2 = hWnd(#main.bt2)&amp;lt;br/&amp;gt;    hButton3 = hWnd(#main.bt3)&amp;lt;br/&amp;gt;    hButton4 = hWnd(#main.bt4)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;===============================================&amp;lt;br/&amp;gt;&#039;To load bitmaps from disk, use&amp;lt;br/&amp;gt;    &#039;Loadbmp &amp;amp;quot;buttonPic1&amp;amp;quot;, &amp;amp;quot;buttonPic1.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;    &#039;Loadbmp &amp;amp;quot;buttonPic2&amp;amp;quot;, &amp;amp;quot;buttonPic2.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;    &#039;etc.&amp;lt;br/&amp;gt;&#039;===============================================&amp;lt;br/&amp;gt;&#039;For this demo, the bitmaps will be drawn and captured&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Down; Fill Black; Size 2&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Color Lightgray; Backcolor DarkRed&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Place 2 2; Boxfilled 38 28&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Getbmp buttonPic1 0 0 40 30&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Backcolor Darkblue&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Place 2 2; Boxfilled 38 28&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Getbmp buttonPic2 0 0 40 30&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Backcolor Yellow&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Place 2 2; Boxfilled 38 28&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Getbmp buttonPic3 0 0 40 30&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Backcolor Darkgreen&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Place 2 2; Boxfilled 38 28&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Getbmp buttonPic4 0 0 40 30&amp;amp;quot;&amp;lt;br/&amp;gt;&#039;===============================================&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Get the handle of the bitmaps&amp;lt;br/&amp;gt;    hPic1 = hBmp(&amp;amp;quot;buttonPic1&amp;amp;quot;)&amp;lt;br/&amp;gt;    hPic2 = hBmp(&amp;amp;quot;buttonPic2&amp;amp;quot;)&amp;lt;br/&amp;gt;    hPic3 = hBmp(&amp;amp;quot;buttonPic3&amp;amp;quot;)&amp;lt;br/&amp;gt;    hPic4 = hBmp(&amp;amp;quot;buttonPic4&amp;amp;quot;)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Paint the bitmaps on the buttons&amp;lt;br/&amp;gt;    For i = 1 to 4&amp;lt;br/&amp;gt;        Select Case i&amp;lt;br/&amp;gt;            Case 1&amp;lt;br/&amp;gt;                hBtn = hButton1&amp;lt;br/&amp;gt;                hPic = hPic1&amp;lt;br/&amp;gt;            Case 2&amp;lt;br/&amp;gt;                hBtn = hButton2&amp;lt;br/&amp;gt;                hPic = hPic2&amp;lt;br/&amp;gt;            Case 3&amp;lt;br/&amp;gt;                hBtn = hButton3&amp;lt;br/&amp;gt;                hPic = hPic3&amp;lt;br/&amp;gt;            Case 4&amp;lt;br/&amp;gt;                hBtn = hButton4&amp;lt;br/&amp;gt;                hPic = hPic4&amp;lt;br/&amp;gt;        End Select&amp;lt;br/&amp;gt;        CallDll #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;            hBtn as uLong, _&amp;lt;br/&amp;gt;            _BM_SETIMAGE as Long, _&amp;lt;br/&amp;gt;            _IMAGE_BITMAP as Long, _&amp;lt;br/&amp;gt;            hPic as uLong, _&amp;lt;br/&amp;gt;            result as Long&amp;lt;br/&amp;gt;    Next i&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Erase button drawings in graphicbox&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Cls; Fill Black&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Wait for user input&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Find which checkbox checked&amp;lt;br/&amp;gt;&#039;Fill quadrant with designated color&amp;lt;br/&amp;gt;    Sub checked handle$&amp;lt;br/&amp;gt;        clr = Val(Right$(handle$, 1))&amp;lt;br/&amp;gt;        Select Case clr&amp;lt;br/&amp;gt;            Case 1&amp;lt;br/&amp;gt;                #main.gb &amp;amp;quot;Color Darkred; Backcolor Darkred&amp;amp;quot;&amp;lt;br/&amp;gt;                x = 1&amp;lt;br/&amp;gt;                y = 1&amp;lt;br/&amp;gt;            Case 2&amp;lt;br/&amp;gt;                #main.gb &amp;amp;quot;Color Darkblue; Backcolor Darkblue&amp;amp;quot;&amp;lt;br/&amp;gt;                x = 1&amp;lt;br/&amp;gt;                y = 61&amp;lt;br/&amp;gt;            Case 3&amp;lt;br/&amp;gt;                #main.gb &amp;amp;quot;Color Yellow; Backcolor Yellow&amp;amp;quot;&amp;lt;br/&amp;gt;                x = 101&amp;lt;br/&amp;gt;                y = 1&amp;lt;br/&amp;gt;            Case 4&amp;lt;br/&amp;gt;                #main.gb &amp;amp;quot;Color Darkgreen; Backcolor Darkgreen&amp;amp;quot;&amp;lt;br/&amp;gt;                x = 101&amp;lt;br/&amp;gt;                y = 61&amp;lt;br/&amp;gt;        End Select&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Place &amp;amp;quot;;x;&amp;amp;quot; &amp;amp;quot;;y&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Boxfilled &amp;amp;quot;;x + 99;&amp;amp;quot; &amp;amp;quot;;y + 59&amp;lt;br/&amp;gt;        End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Find which checkbox unchecked&amp;lt;br/&amp;gt;&#039;Fill appropriate quadrant with black&amp;lt;br/&amp;gt;    Sub unchecked handle$&amp;lt;br/&amp;gt;        clr = Val(Right$(handle$, 1))&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Color Black; Backcolor Black&amp;amp;quot;&amp;lt;br/&amp;gt;        Select Case clr&amp;lt;br/&amp;gt;            Case 1&amp;lt;br/&amp;gt;                x = 1&amp;lt;br/&amp;gt;                y = 1&amp;lt;br/&amp;gt;            Case 2&amp;lt;br/&amp;gt;                x = 1&amp;lt;br/&amp;gt;                y = 61&amp;lt;br/&amp;gt;            Case 3&amp;lt;br/&amp;gt;                x = 101&amp;lt;br/&amp;gt;                y = 1&amp;lt;br/&amp;gt;            Case 4&amp;lt;br/&amp;gt;                x = 101&amp;lt;br/&amp;gt;                y = 61&amp;lt;br/&amp;gt;        End Select&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Place &amp;amp;quot;;x;&amp;amp;quot; &amp;amp;quot;;y&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Boxfilled &amp;amp;quot;;x + 99;&amp;amp;quot; &amp;amp;quot;;y + 59&amp;lt;br/&amp;gt;        End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;End the program&amp;lt;br/&amp;gt;    Sub endDemo handle$&amp;lt;br/&amp;gt;&#039;Unload bitmaps to free memory&amp;lt;br/&amp;gt;        For i = 1 to 4&amp;lt;br/&amp;gt;            Unloadbmp &amp;amp;quot;buttonPic&amp;amp;quot;;i&amp;lt;br/&amp;gt;        Next i&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;        End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Demonstration of using Stylebits to turn checkboxes into
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;push buttons
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Based on code provided by Stefan Pendl
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Yahoo! Message ##27196
&lt;/span&gt;
    Nomainwin
&amp;nbsp;
    WindowWidth = 207
    WindowHeight = 297
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Groupbox defines Checkbox Area
&lt;/span&gt;    Groupbox #main.gp, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color&amp;quot;&lt;/span&gt;, 10, 10, 120, 100
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Draw checkboxes that will look like push buttons
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Stylebits _BS_PUSHLIKE causes checkbox to resemble push button
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Stylebits _BS_BITMAP allows a bitmap to be drawn on button
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Be sure to set width and height to bitmap dimensions
&lt;/span&gt;    Stylebits #main.bt1, _BS_PUSHLIKE &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0
    Checkbox #main.bt1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, checked, unchecked, 20, 30, 40, 30
    Stylebits #main.bt2, _BS_PUSHLIKE &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0
    Checkbox #main.bt2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, checked, unchecked, 20, 70, 40, 30
    Stylebits #main.bt3, _BS_PUSHLIKE &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0
    Checkbox #main.bt3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, checked, unchecked, 80, 30, 40, 30
    Stylebits #main.bt4, _BS_PUSHLIKE &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0
    Checkbox #main.bt4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, checked, unchecked, 80, 70, 40, 30
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;For this demo, a graphicbox is needed to draw and capture bitmaps
&lt;/span&gt;    Graphicbox #main.gb, 0, 150, 200, 120
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits and Checkboxes&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose endDemo&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Obtain handle of the main window
&lt;/span&gt;    hMain = hWnd(#main)
&lt;span class=&quot;co1&quot;&gt;&#039;Obtain handles of the 4 checkboxes
&lt;/span&gt;    hButton1 = hWnd(#main.bt1)
    hButton2 = hWnd(#main.bt2)
    hButton3 = hWnd(#main.bt3)
    hButton4 = hWnd(#main.bt4)
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;===============================================
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;To load bitmaps from disk, use
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;Loadbmp &amp;quot;buttonPic1&amp;quot;, &amp;quot;buttonPic1.bmp&amp;quot;
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;Loadbmp &amp;quot;buttonPic2&amp;quot;, &amp;quot;buttonPic2.bmp&amp;quot;
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;etc.
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;===============================================
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;For this demo, the bitmaps will be drawn and captured
&lt;/span&gt;    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Down; Fill Black; Size 2&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Lightgray; Backcolor DarkRed&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 2 2; Boxfilled 38 28&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Getbmp buttonPic1 0 0 40 30&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Backcolor Darkblue&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 2 2; Boxfilled 38 28&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Getbmp buttonPic2 0 0 40 30&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Backcolor Yellow&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 2 2; Boxfilled 38 28&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Getbmp buttonPic3 0 0 40 30&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Backcolor Darkgreen&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 2 2; Boxfilled 38 28&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Getbmp buttonPic4 0 0 40 30&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;===============================================
&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;Get the handle of the bitmaps
&lt;/span&gt;    hPic1 = hBmp(&lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonPic1&amp;quot;&lt;/span&gt;)
    hPic2 = hBmp(&lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonPic2&amp;quot;&lt;/span&gt;)
    hPic3 = hBmp(&lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonPic3&amp;quot;&lt;/span&gt;)
    hPic4 = hBmp(&lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonPic4&amp;quot;&lt;/span&gt;)
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Paint the bitmaps on the buttons
&lt;/span&gt;    &lt;span class=&quot;kw3&quot;&gt;For&lt;/span&gt; i = 1 &lt;span class=&quot;kw3&quot;&gt;to&lt;/span&gt; 4
        &lt;span class=&quot;kw3&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; i
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 1
                hBtn = hButton1
                hPic = hPic1
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 2
                hBtn = hButton2
                hPic = hPic2
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 3
                hBtn = hButton3
                hPic = hPic3
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 4
                hBtn = hButton4
                hPic = hPic4
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Select&lt;/span&gt;
        CallDll #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;, _
            hBtn &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; uLong, _
            _BM_SETIMAGE &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
            _IMAGE_BITMAP &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
            hPic &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; uLong, _
            result &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;Next&lt;/span&gt; i
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Erase button drawings in graphicbox
&lt;/span&gt;    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Cls; Fill Black&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Wait for user input
&lt;/span&gt;    Wait
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Find which checkbox checked
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Fill quadrant with designated color
&lt;/span&gt;    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; checked handle$
        clr = Val(Right$(handle$, 1))
        &lt;span class=&quot;kw3&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; clr
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 1
                #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Darkred; Backcolor Darkred&amp;quot;&lt;/span&gt;
                x = 1
                y = 1
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 2
                #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Darkblue; Backcolor Darkblue&amp;quot;&lt;/span&gt;
                x = 1
                y = 61
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 3
                #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Yellow; Backcolor Yellow&amp;quot;&lt;/span&gt;
                x = 101
                y = 1
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 4
                #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Darkgreen; Backcolor Darkgreen&amp;quot;&lt;/span&gt;
                x = 101
                y = 61
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Select&lt;/span&gt;
        #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;x;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;y
        #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Boxfilled &amp;quot;&lt;/span&gt;;x + 99;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;y + 59
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Find which checkbox unchecked
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Fill appropriate quadrant with black
&lt;/span&gt;    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; unchecked handle$
        clr = Val(Right$(handle$, 1))
        #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Black; Backcolor Black&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; clr
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 1
                x = 1
                y = 1
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 2
                x = 1
                y = 61
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 3
                x = 101
                y = 1
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 4
                x = 101
                y = 61
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Select&lt;/span&gt;
        #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;x;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;y
        #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Boxfilled &amp;quot;&lt;/span&gt;;x + 99;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;y + 59
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;End the program
&lt;/span&gt;    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; endDemo handle$
&lt;span class=&quot;co1&quot;&gt;&#039;Unload bitmaps to free memory
&lt;/span&gt;        &lt;span class=&quot;kw3&quot;&gt;For&lt;/span&gt; i = 1 &lt;span class=&quot;kw3&quot;&gt;to&lt;/span&gt; 4
            Unloadbmp &lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonPic&amp;quot;&lt;/span&gt;;i
        &lt;span class=&quot;kw3&quot;&gt;Next&lt;/span&gt; i
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x--Button Event Handlers: Branch Label or Sub?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Button Event Handlers: Branch Label or Sub?&lt;/h3&gt;
&lt;br /&gt;
As is the case with most event handlers, the button event handler can be either a branch label or a sub.  The advantage of using a sub with grouped checkboxes or radiobuttons is that the control handle is automatically passed into the sub.  With careful parsing of the control handle extension and the use of Select Case, code becomes much more efficient than is possible with branch labels.  The following demo contains just four radiobuttons within a group, but could easily serve a group of 100 radiobuttons or more.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;&#039;Demonstration of using Stylebits to turn radiobuttons into&amp;lt;br/&amp;gt;&#039;push buttons&amp;lt;br/&amp;gt;&#039;Based on code provided by Stefan Pendl&amp;lt;br/&amp;gt;&#039;Yahoo! Message ##27196&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    WindowWidth = 207&amp;lt;br/&amp;gt;    WindowHeight = 297&amp;lt;br/&amp;gt;    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)&amp;lt;br/&amp;gt;    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Groupbox defines Radiobuttons Area&amp;lt;br/&amp;gt;    Groupbox #main.gp, &amp;amp;quot;Color&amp;amp;quot;, 10, 10, 120, 100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Draw radiobuttons that will look like push buttons&amp;lt;br/&amp;gt;&#039;Stylebits _BS_PUSHLIKE causes radiobutton to resemble push button&amp;lt;br/&amp;gt;&#039;Stylebits _BS_BITMAP allows a bitmap to be drawn on button&amp;lt;br/&amp;gt;&#039;Be sure to set width and height to bitmap dimensions&amp;lt;br/&amp;gt;    Stylebits #main.bt1, _BS_PUSHLIKE or _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Radiobutton #main.bt1, &amp;amp;quot;&amp;amp;quot;, selected, unselected, 20, 30, 40, 30&amp;lt;br/&amp;gt;    Stylebits #main.bt2, _BS_PUSHLIKE or _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Radiobutton #main.bt2, &amp;amp;quot;&amp;amp;quot;, selected, unselected, 20, 70, 40, 30&amp;lt;br/&amp;gt;    Stylebits #main.bt3, _BS_PUSHLIKE or _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Radiobutton #main.bt3, &amp;amp;quot;&amp;amp;quot;, selected, unselected, 80, 30, 40, 30&amp;lt;br/&amp;gt;    Stylebits #main.bt4, _BS_PUSHLIKE or _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0&amp;lt;br/&amp;gt;    Radiobutton #main.bt4, &amp;amp;quot;&amp;amp;quot;, selected, unselected, 80, 70, 40, 30&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;For this demo, a graphicbox is needed to draw and capture bitmaps&amp;lt;br/&amp;gt;    Graphicbox #main.gb, 0, 150, 200, 120&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Stylebits and Radiobuttons&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    #main &amp;amp;quot;Trapclose endDemo&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Obtain handle of the main window&amp;lt;br/&amp;gt;    hMain = hWnd(#main)&amp;lt;br/&amp;gt;&#039;Obtain handles of the 4 radiobuttons&amp;lt;br/&amp;gt;    hButton1 = hWnd(#main.bt1)&amp;lt;br/&amp;gt;    hButton2 = hWnd(#main.bt2)&amp;lt;br/&amp;gt;    hButton3 = hWnd(#main.bt3)&amp;lt;br/&amp;gt;    hButton4 = hWnd(#main.bt4)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;===============================================&amp;lt;br/&amp;gt;&#039;To load bitmaps from disk, use&amp;lt;br/&amp;gt;    &#039;Loadbmp &amp;amp;quot;buttonPic1&amp;amp;quot;, &amp;amp;quot;buttonPic1.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;    &#039;Loadbmp &amp;amp;quot;buttonPic2&amp;amp;quot;, &amp;amp;quot;buttonPic2.bmp&amp;amp;quot;&amp;lt;br/&amp;gt;    &#039;etc.&amp;lt;br/&amp;gt;&#039;===============================================&amp;lt;br/&amp;gt;&#039;For this demo, the bitmaps will be drawn and captured&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Down; Fill Black; Size 2&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Color Lightgray; Backcolor DarkRed&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Place 2 2; Boxfilled 38 28&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Getbmp buttonPic1 0 0 40 30&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Backcolor Darkblue&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Place 2 2; Boxfilled 38 28&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Getbmp buttonPic2 0 0 40 30&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Backcolor Yellow&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Place 2 2; Boxfilled 38 28&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Getbmp buttonPic3 0 0 40 30&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Backcolor Darkgreen&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Place 2 2; Boxfilled 38 28&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Getbmp buttonPic4 0 0 40 30&amp;amp;quot;&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Backcolor Black; Fill Black&amp;amp;quot;&amp;lt;br/&amp;gt;&#039;===============================================&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Get the handle of the bitmaps&amp;lt;br/&amp;gt;    hPic1 = hBmp(&amp;amp;quot;buttonPic1&amp;amp;quot;)&amp;lt;br/&amp;gt;    hPic2 = hBmp(&amp;amp;quot;buttonPic2&amp;amp;quot;)&amp;lt;br/&amp;gt;    hPic3 = hBmp(&amp;amp;quot;buttonPic3&amp;amp;quot;)&amp;lt;br/&amp;gt;    hPic4 = hBmp(&amp;amp;quot;buttonPic4&amp;amp;quot;)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Paint the bitmaps on the radiobuttons&amp;lt;br/&amp;gt;    For i = 1 to 4&amp;lt;br/&amp;gt;        Select Case i&amp;lt;br/&amp;gt;            Case 1&amp;lt;br/&amp;gt;                hBtn = hButton1&amp;lt;br/&amp;gt;                hPic = hPic1&amp;lt;br/&amp;gt;            Case 2&amp;lt;br/&amp;gt;                hBtn = hButton2&amp;lt;br/&amp;gt;                hPic = hPic2&amp;lt;br/&amp;gt;            Case 3&amp;lt;br/&amp;gt;                hBtn = hButton3&amp;lt;br/&amp;gt;                hPic = hPic3&amp;lt;br/&amp;gt;            Case 4&amp;lt;br/&amp;gt;                hBtn = hButton4&amp;lt;br/&amp;gt;                hPic = hPic4&amp;lt;br/&amp;gt;        End Select&amp;lt;br/&amp;gt;        CallDll #user32, &amp;amp;quot;SendMessageA&amp;amp;quot;, _&amp;lt;br/&amp;gt;            hBtn as uLong, _&amp;lt;br/&amp;gt;            _BM_SETIMAGE as Long, _&amp;lt;br/&amp;gt;            _IMAGE_BITMAP as Long, _&amp;lt;br/&amp;gt;            hPic as uLong, _&amp;lt;br/&amp;gt;            result as Long&amp;lt;br/&amp;gt;    Next i&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Erase button drawings in graphicbox&amp;lt;br/&amp;gt;    #main.gb &amp;amp;quot;Cls; Fill Black&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Wait for user input&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;Find which radiobutton checked&amp;lt;br/&amp;gt;&#039;Fill quadrant with designated color&amp;lt;br/&amp;gt;    Sub selected handle$&amp;lt;br/&amp;gt;        clr = Val(Right$(handle$, 1))&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Cls; Fill Black&amp;amp;quot;&amp;lt;br/&amp;gt;        Select Case clr&amp;lt;br/&amp;gt;            Case 1&amp;lt;br/&amp;gt;                #main.gb &amp;amp;quot;Color Darkred; Backcolor Darkred&amp;amp;quot;&amp;lt;br/&amp;gt;                x = 1&amp;lt;br/&amp;gt;                y = 1&amp;lt;br/&amp;gt;            Case 2&amp;lt;br/&amp;gt;                #main.gb &amp;amp;quot;Color Darkblue; Backcolor Darkblue&amp;amp;quot;&amp;lt;br/&amp;gt;                x = 1&amp;lt;br/&amp;gt;                y = 61&amp;lt;br/&amp;gt;            Case 3&amp;lt;br/&amp;gt;                #main.gb &amp;amp;quot;Color Yellow; Backcolor Yellow&amp;amp;quot;&amp;lt;br/&amp;gt;                x = 101&amp;lt;br/&amp;gt;                y = 1&amp;lt;br/&amp;gt;            Case 4&amp;lt;br/&amp;gt;                #main.gb &amp;amp;quot;Color Darkgreen; Backcolor Darkgreen&amp;amp;quot;&amp;lt;br/&amp;gt;                x = 101&amp;lt;br/&amp;gt;                y = 61&amp;lt;br/&amp;gt;        End Select&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Place &amp;amp;quot;;x;&amp;amp;quot; &amp;amp;quot;;y&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Boxfilled &amp;amp;quot;;x + 99;&amp;amp;quot; &amp;amp;quot;;y + 59&amp;lt;br/&amp;gt;        End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;As is the case with any radiobutton, an&amp;lt;br/&amp;gt;&#039;Unset event handler needs to be defined&amp;lt;br/&amp;gt;&#039;but is never actually executed&amp;lt;br/&amp;gt;    Sub unselected handle$&amp;lt;br/&amp;gt;        clr = Val(Right$(handle$, 1))&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Color Black; Backcolor Black&amp;amp;quot;&amp;lt;br/&amp;gt;        #main.gb &amp;amp;quot;Cls; Fill Black&amp;amp;quot;&amp;lt;br/&amp;gt;        End Sub&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&#039;End the program&amp;lt;br/&amp;gt;    Sub endDemo handle$&amp;lt;br/&amp;gt;&#039;Unload bitmaps to free memory&amp;lt;br/&amp;gt;        For i = 1 to 4&amp;lt;br/&amp;gt;            Unloadbmp &amp;amp;quot;buttonPic&amp;amp;quot;;i&amp;lt;br/&amp;gt;        Next i&amp;lt;br/&amp;gt;        Close #main&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;        End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Demonstration of using Stylebits to turn radiobuttons into
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;push buttons
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Based on code provided by Stefan Pendl
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Yahoo! Message ##27196
&lt;/span&gt;
    Nomainwin
&amp;nbsp;
    WindowWidth = 207
    WindowHeight = 297
    UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
    UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Groupbox defines Radiobuttons Area
&lt;/span&gt;    Groupbox #main.gp, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color&amp;quot;&lt;/span&gt;, 10, 10, 120, 100
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Draw radiobuttons that will look like push buttons
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Stylebits _BS_PUSHLIKE causes radiobutton to resemble push button
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Stylebits _BS_BITMAP allows a bitmap to be drawn on button
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Be sure to set width and height to bitmap dimensions
&lt;/span&gt;    Stylebits #main.bt1, _BS_PUSHLIKE &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0
    Radiobutton #main.bt1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, selected, unselected, 20, 30, 40, 30
    Stylebits #main.bt2, _BS_PUSHLIKE &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0
    Radiobutton #main.bt2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, selected, unselected, 20, 70, 40, 30
    Stylebits #main.bt3, _BS_PUSHLIKE &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0
    Radiobutton #main.bt3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, selected, unselected, 80, 30, 40, 30
    Stylebits #main.bt4, _BS_PUSHLIKE &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _BS_BITMAP, 0, _WS_EX_DLGMODALFRAME, 0
    Radiobutton #main.bt4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, selected, unselected, 80, 70, 40, 30
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;For this demo, a graphicbox is needed to draw and capture bitmaps
&lt;/span&gt;    Graphicbox #main.gb, 0, 150, 200, 120
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits and Radiobuttons&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    #main &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose endDemo&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Obtain handle of the main window
&lt;/span&gt;    hMain = hWnd(#main)
&lt;span class=&quot;co1&quot;&gt;&#039;Obtain handles of the 4 radiobuttons
&lt;/span&gt;    hButton1 = hWnd(#main.bt1)
    hButton2 = hWnd(#main.bt2)
    hButton3 = hWnd(#main.bt3)
    hButton4 = hWnd(#main.bt4)
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;===============================================
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;To load bitmaps from disk, use
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;Loadbmp &amp;quot;buttonPic1&amp;quot;, &amp;quot;buttonPic1.bmp&amp;quot;
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;Loadbmp &amp;quot;buttonPic2&amp;quot;, &amp;quot;buttonPic2.bmp&amp;quot;
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;etc.
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;===============================================
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;For this demo, the bitmaps will be drawn and captured
&lt;/span&gt;    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Down; Fill Black; Size 2&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Lightgray; Backcolor DarkRed&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 2 2; Boxfilled 38 28&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Getbmp buttonPic1 0 0 40 30&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Backcolor Darkblue&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 2 2; Boxfilled 38 28&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Getbmp buttonPic2 0 0 40 30&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Backcolor Yellow&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 2 2; Boxfilled 38 28&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Getbmp buttonPic3 0 0 40 30&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Backcolor Darkgreen&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place 2 2; Boxfilled 38 28&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Getbmp buttonPic4 0 0 40 30&amp;quot;&lt;/span&gt;
    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Backcolor Black; Fill Black&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;===============================================
&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;Get the handle of the bitmaps
&lt;/span&gt;    hPic1 = hBmp(&lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonPic1&amp;quot;&lt;/span&gt;)
    hPic2 = hBmp(&lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonPic2&amp;quot;&lt;/span&gt;)
    hPic3 = hBmp(&lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonPic3&amp;quot;&lt;/span&gt;)
    hPic4 = hBmp(&lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonPic4&amp;quot;&lt;/span&gt;)
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Paint the bitmaps on the radiobuttons
&lt;/span&gt;    &lt;span class=&quot;kw3&quot;&gt;For&lt;/span&gt; i = 1 &lt;span class=&quot;kw3&quot;&gt;to&lt;/span&gt; 4
        &lt;span class=&quot;kw3&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; i
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 1
                hBtn = hButton1
                hPic = hPic1
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 2
                hBtn = hButton2
                hPic = hPic2
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 3
                hBtn = hButton3
                hPic = hPic3
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 4
                hBtn = hButton4
                hPic = hPic4
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Select&lt;/span&gt;
        CallDll #user32, &lt;span class=&quot;st0&quot;&gt;&amp;quot;SendMessageA&amp;quot;&lt;/span&gt;, _
            hBtn &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; uLong, _
            _BM_SETIMAGE &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
            _IMAGE_BITMAP &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _
            hPic &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; uLong, _
            result &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;Next&lt;/span&gt; i
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Erase button drawings in graphicbox
&lt;/span&gt;    #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Cls; Fill Black&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Wait for user input
&lt;/span&gt;    Wait
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;Find which radiobutton checked
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Fill quadrant with designated color
&lt;/span&gt;    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; selected handle$
        clr = Val(Right$(handle$, 1))
        #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Cls; Fill Black&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; clr
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 1
                #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Darkred; Backcolor Darkred&amp;quot;&lt;/span&gt;
                x = 1
                y = 1
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 2
                #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Darkblue; Backcolor Darkblue&amp;quot;&lt;/span&gt;
                x = 1
                y = 61
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 3
                #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Yellow; Backcolor Yellow&amp;quot;&lt;/span&gt;
                x = 101
                y = 1
            &lt;span class=&quot;kw3&quot;&gt;Case&lt;/span&gt; 4
                #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Darkgreen; Backcolor Darkgreen&amp;quot;&lt;/span&gt;
                x = 101
                y = 61
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Select&lt;/span&gt;
        #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Place &amp;quot;&lt;/span&gt;;x;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;y
        #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Boxfilled &amp;quot;&lt;/span&gt;;x + 99;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;;y + 59
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;As is the case with any radiobutton, an
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;Unset event handler needs to be defined
&lt;/span&gt;&lt;span class=&quot;co1&quot;&gt;&#039;but is never actually executed
&lt;/span&gt;    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; unselected handle$
        clr = Val(Right$(handle$, 1))
        #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Color Black; Backcolor Black&amp;quot;&lt;/span&gt;
        #main.gb &lt;span class=&quot;st0&quot;&gt;&amp;quot;Cls; Fill Black&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;&#039;End the program
&lt;/span&gt;    &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; endDemo handle$
&lt;span class=&quot;co1&quot;&gt;&#039;Unload bitmaps to free memory
&lt;/span&gt;        &lt;span class=&quot;kw3&quot;&gt;For&lt;/span&gt; i = 1 &lt;span class=&quot;kw3&quot;&gt;to&lt;/span&gt; 4
            Unloadbmp &lt;span class=&quot;st0&quot;&gt;&amp;quot;buttonPic&amp;quot;&lt;/span&gt;;i
        &lt;span class=&quot;kw3&quot;&gt;Next&lt;/span&gt; i
        &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;x--A List of Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;A List of Stylebits&lt;/h3&gt;
&lt;br /&gt;
You can get a list of all &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632600(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwStyles&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwExStyles&lt;/a&gt; available with the Stylebits command at the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb775951(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;MSDN Library - Button Styles&lt;/a&gt;.&lt;br /&gt;
Be sure to precede these constants with an underscore (if constant is BS_PUSHLIKE, then LB Stylebits is _BS_PUSHLIKE) when using Windows constants in your Liberty BASIC programs.</description>
          </item>
    <item>
      <title>Stylebits - Windows</title>
      <link>https://lbpe.wikispaces.com/Stylebits+-+Windows</link>
      <dc:creator>StPendl</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/Stylebits+-+Windows</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/Stylebits+-+Windows</comments>
      <pubDate>Sun, 07 Dec 2008 11:43:18 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:3:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x-Defining the Window&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:3 --&gt;Defining the Window&lt;/h2&gt;
&lt;br /&gt;
To understand how stylebits can modify a window, it&#039;s important to first understand what the traditional window looks like and how it behaves.  Generally speaking, a window is distinguishable from the rest of the screen by its borders.  The borders create a box.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;Open &amp;amp;quot;My Window&amp;amp;quot; for Window as #1&amp;lt;br/&amp;gt;Print #1, &amp;amp;quot;Trapclose [closeWindow]&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[closeWindow]&amp;lt;br/&amp;gt;Close #1&amp;lt;br/&amp;gt;End&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;My Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #1
&lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [closeWindow]&amp;quot;&lt;/span&gt;
&amp;nbsp;
Wait
&amp;nbsp;
[closeWindow]
&lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #1
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x-Defining the Window-Types of Windows&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;Types of Windows&lt;/h3&gt;
&lt;br /&gt;
The Liberty BASIC Help File identifies these four types of windows created using native LB commands:&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;WINDOW - the most common and the most useful, used to hold controls, can include one or more menus, can trap TAB key to move focus from one control to another.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;GRAPHICS - designed to display graphics and sprites, not intended to hold controls, can trap mouse clicks and character key presses.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;DIALOG - similar to the traditional window, can contain controls, cannot contain menus, can trap ENTER key as a special button to direct action.  When displayed as &amp;quot;modal,&amp;quot; the dialog window remain in focus until closed.  (The prompt, notice and confirm windows are special dialog modal windows.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;TEXT - Limited to writing and editing text, always contain a menubar that contains a read-made File Menu and a ready-made Edit Menu.  (The Mainwindow is a Text Window.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
There are many native variations of these four windows.  See the Helpfile for variations such as full screen (_fs), _nf (no sizing frame), no scroll bars (_nsb), no titlebar (_popup), among others.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x-Defining the Window-Elements of a Window&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;Elements of a Window&lt;/h3&gt;
&lt;br /&gt;
For an explanation of the parts of a window, visit this &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.functionx.com/win32/Lesson07.htm&quot; rel=&quot;nofollow&quot;&gt;tutorial&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
As well as the borders of the window box, the typical window contains a blue title bar along its top.  The windows constant for the border is WS_BORDER and for the title bar is WS_CAPTION.  The window icon, the small picture located in the left portion of the title bar is referred to as WS_SYSMENU.  Double-clicking this icon reveals the window menu (Restore, Move, Size, Minimize, Maximize, Close).  In addition, there are three buttons located in the right portion of the title bar.  They are&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;the minimize button or WS_MINIMIZEBOX&lt;/li&gt;&lt;li&gt;the maximize button or WS_MAXIMIZEBOX&lt;/li&gt;&lt;li&gt;the trapclose button.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x-Defining the Window-Using Window Styles Constants in Your Program&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Using Window Styles Constants in Your Program&lt;/h3&gt;
&lt;br /&gt;
Window styling changes have long been available in Liberty BASIC using the API calls &lt;strong&gt;SendMessageLong&lt;/strong&gt;.  Liberty BASIC v4.x offers the programmer the opportunity to modify these styles using the native command STYLEBITS.  Stylebits commands are used to access or change the style and attributes of a window and other controls.  There are two categories of styles: standard and extended.&lt;br /&gt;
&lt;br /&gt;
Extended attributes resulted from newer CreateWindwoEX functions so they are more useful in adding qualities rather than removing qualities.  Both categories are represented as flags in 32 - bit integers.  These styles must be applied to the window and / or controls before the gui is opened.&lt;br /&gt;
&lt;br /&gt;
The stylebits of any particular window and the controls of that window may not be altered after the window is opened except, in some but not all cases, with API calls.&lt;br /&gt;
&lt;br /&gt;
From the Liberty BASIC v4.01 Help File&lt;br /&gt;
&lt;em&gt;stylebits #handle, addBits, removeBits, addExtendedBits, removeExtendedBits&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;STYLEBITS allows you to change the style of a Liberty BASIC window or control. It accepts a handle and four parameters. When the window is opened it checks to see if there are style bits for the window or for any controls. If there is a STYLEBITS command it applies the remove bits first, then applies the add bits. In this way the control is created from the get-go with the desired style. The STYLEBITS command must be issued before the command to open the window.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
Most often you can recognize whether a stylebit is standard (dwStyle) or extended (dwExStyle) by its Window Constant.  The stylebit WS_CAPTION can be passed as the first (addBits) or second (removeBits) parameter, while the stylebit WS_EX_TOPMOST is passed as either the third (addExtendedBits) or fourth (removeExtendedBits) parameter.  Liberty BASIC recognizes window constants by placing an additional underscore immediately in front of the constant, e.g, _WS_CAPTION.  Run this demo to see how window attributes can be both added and removed.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    &#039;This Demo opens up to five independent windows.  The windows&amp;lt;br/&amp;gt;    &#039;will be placed side by side for visual comparison.  The left (primary)&amp;lt;br/&amp;gt;    &#039;window is opened &#039;as is&#039; with no Stylebits assigned.  The&amp;lt;br/&amp;gt;    &#039;right windows show windows with attributes either added&amp;lt;br/&amp;gt;    &#039;or removed by the use of the Stylebits command.&amp;lt;br/&amp;gt;    &#039;This demo requires Liberty BASIC v4.x or greater.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    If Val(Version$) &amp;amp;lt; 4 Then&amp;lt;br/&amp;gt;        Notice &amp;amp;quot;This program requires Liberty BASIC V4.0 or greater&amp;amp;quot;&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;    End If&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    &#039;The main (left) window - No stylebits assigned&amp;lt;br/&amp;gt;    WindowWidth = 300&amp;lt;br/&amp;gt;    WindowHeight = 350&amp;lt;br/&amp;gt;    UpperLeftX = 50&amp;lt;br/&amp;gt;    UpperLeftY = 100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #main.0a, &amp;amp;quot;No Stylebits commands have been used in this window&amp;amp;quot;, 20, 10, 260, 40&amp;lt;br/&amp;gt;    Statictext #main.0b, &amp;amp;quot;Click on any of the buttons to see Stylebits in action&amp;amp;quot;, 20, 50, 260, 40&amp;lt;br/&amp;gt;    Button #main.1, &amp;amp;quot;addBits: Vertical Scroll Bar&amp;amp;quot;, [parameter1], UL, 15, 120, 270, 30&amp;lt;br/&amp;gt;    Button #main.2, &amp;amp;quot;removeBits: Maximize Button&amp;amp;quot;, [parameter2], UL, 15, 160, 270, 30&amp;lt;br/&amp;gt;    Button #main.3, &amp;amp;quot;addExtendedBits: Sunken Edge Border&amp;amp;quot;, [parameter3], UL, 15, 200, 270, 30&amp;lt;br/&amp;gt;    Button #main.4, &amp;amp;quot;removeExtendedBits: No Demo&amp;amp;quot;, [parameter4], UL, 15, 240, 270, 30&amp;lt;br/&amp;gt;    Button #main.5, &amp;amp;quot;See All 3 Stylebits Commands&amp;amp;quot;, [parameterAll], UL, 15, 280, 270, 30&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;The Window - AS IS&amp;amp;quot; for Window as #main&amp;lt;br/&amp;gt;    Print #main, &amp;amp;quot;Trapclose [endDemo]&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #main, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[parameter1]&amp;lt;br/&amp;gt;    &#039;addBits: Add a vertical scroll bar to the window&amp;lt;br/&amp;gt;    WindowWidth = 300&amp;lt;br/&amp;gt;    WindowHeight = 350&amp;lt;br/&amp;gt;    UpperLeftX = 400&amp;lt;br/&amp;gt;    UpperLeftY = 100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #1, _WS_VSCROLL, 0, 0, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #1.0a, &amp;amp;quot;A regular window does not normally include a vertical scroll bar.&amp;amp;quot;, 20, 10, 260, 40&amp;lt;br/&amp;gt;    Statictext #1.0b, &amp;amp;quot;The Stylebits (1st parameter) has ADDED this feature.&amp;amp;quot;, 20, 50, 260, 40&amp;lt;br/&amp;gt;    Statictext #1.1, &amp;amp;quot;addBits: Vertical Scroll Bar&amp;amp;quot;, 15, 120, 270, 20&amp;lt;br/&amp;gt;    Statictext #1.2, &amp;amp;quot;Stylebits #1, _WS_VSCROLL, 0, 0, 0&amp;amp;quot;, 15, 160, 270, 40&amp;lt;br/&amp;gt;    Button #1.3, &amp;amp;quot;Close&amp;amp;quot;, [close1], UL, 120, 250&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;addBits: Vertical Scroll Bar&amp;amp;quot; for Window as #1&amp;lt;br/&amp;gt;    Print #1, &amp;amp;quot;Trapclose [close1]&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #1, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    window1 = 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[close1]&amp;lt;br/&amp;gt;    Close #1&amp;lt;br/&amp;gt;    window1 = 0&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[parameter2]&amp;lt;br/&amp;gt;    &#039;removeBits: Remove the maximize button&amp;lt;br/&amp;gt;    WindowWidth = 300&amp;lt;br/&amp;gt;    WindowHeight = 350&amp;lt;br/&amp;gt;    UpperLeftX = 400&amp;lt;br/&amp;gt;    UpperLeftY = 100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #2, 0, _WS_MAXIMIZEBOX, 0, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #2.0a, &amp;amp;quot;A regular window contains a maximize button&amp;amp;quot;, 20, 10, 260, 40&amp;lt;br/&amp;gt;    Statictext #2.0b, &amp;amp;quot;The Stylebits (2nd parameter) has REMOVED this feature.&amp;amp;quot;, 20, 50, 260, 40&amp;lt;br/&amp;gt;    Statictext #2.1, &amp;amp;quot;removeBits: Maximize Window&amp;amp;quot;, 15, 120, 270, 20&amp;lt;br/&amp;gt;    Statictext #2.2, &amp;amp;quot;Stylebits #2, 0, _WS_MAXIMIZEBOX, 0, 0&amp;amp;quot;, 15, 160, 270, 40&amp;lt;br/&amp;gt;    Button #2.3, &amp;amp;quot;Close&amp;amp;quot;, [close2], UL, 120, 250&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;removeBits: Maximize Window&amp;amp;quot; for Window as #2&amp;lt;br/&amp;gt;    Print #2, &amp;amp;quot;Trapclose [close2]&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #2, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    window2 = 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[close2]&amp;lt;br/&amp;gt;    Close #2&amp;lt;br/&amp;gt;    window2 = 0&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[parameter3]&amp;lt;br/&amp;gt;    &#039;addExtendedBits: Add Sunken Edge Border&amp;lt;br/&amp;gt;    WindowWidth = 300&amp;lt;br/&amp;gt;    WindowHeight = 350&amp;lt;br/&amp;gt;    UpperLeftX = 400&amp;lt;br/&amp;gt;    UpperLeftY = 100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #3, 0, 0, _WS_EX_CLIENTEDGE, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #3.0a, &amp;amp;quot;A regular window has smooth resizable edges.&amp;amp;quot;, 20, 10, 260, 40&amp;lt;br/&amp;gt;    Statictext #3.0b, &amp;amp;quot;The Stylebits (3rd parameter) has altered the edges.&amp;amp;quot;, 20, 50, 260, 40&amp;lt;br/&amp;gt;    Statictext #3.1, &amp;amp;quot;addExtendedBits: Sunken Edge Border&amp;amp;quot;, 15, 120, 270, 20&amp;lt;br/&amp;gt;    Statictext #3.2, &amp;amp;quot;Stylebits #3, 0, 0, _WS_EX_CLIENTEDGE, 0&amp;amp;quot;, 15, 160, 270, 40&amp;lt;br/&amp;gt;    Button #3.3, &amp;amp;quot;Close&amp;amp;quot;, [close3], UL, 120, 250&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;addExtendedBits: Sunken Edge Border&amp;amp;quot; for Window as #3&amp;lt;br/&amp;gt;    Print #3, &amp;amp;quot;Trapclose [close3]&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #3, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    window3 = 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[close3]&amp;lt;br/&amp;gt;    Close #3&amp;lt;br/&amp;gt;    window3 = 0&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[parameter4]&amp;lt;br/&amp;gt;    &#039;removeExtendedBits: No Demo&amp;lt;br/&amp;gt;    WindowWidth = 300&amp;lt;br/&amp;gt;    WindowHeight = 350&amp;lt;br/&amp;gt;    UpperLeftX = 400&amp;lt;br/&amp;gt;    UpperLeftY = 100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #4, 0, 0, 0, 0 &#039;No Extended Bits to remove&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #4.0a, &amp;amp;quot;The extended bits are generally added.&amp;amp;quot;, 20, 10, 260, 40&amp;lt;br/&amp;gt;    Statictext #4.0b, &amp;amp;quot;There is no demo for removing extended bits.&amp;amp;quot;, 20, 50, 260, 40&amp;lt;br/&amp;gt;    Statictext #4.1, &amp;amp;quot;addExtendedBits: No Demo&amp;amp;quot;, 15, 120, 270, 20&amp;lt;br/&amp;gt;    Statictext #4.2, &amp;amp;quot;Stylebits #3, 0, 0, 0, 0&amp;amp;quot;, 15, 160, 270, 40&amp;lt;br/&amp;gt;    Button #4.3, &amp;amp;quot;Close&amp;amp;quot;, [close4], UL, 120, 250&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;removeExtendedBits: No Changes&amp;amp;quot; for Window as #4&amp;lt;br/&amp;gt;    Print #4, &amp;amp;quot;Trapclose [close4]&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #4, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    window4 = 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[close4]&amp;lt;br/&amp;gt;    Close #4&amp;lt;br/&amp;gt;    window4 = 0&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[parameterAll]&amp;lt;br/&amp;gt;    &#039;All 3 Stylebits Combined in the Same Window&amp;lt;br/&amp;gt;    WindowWidth = 300&amp;lt;br/&amp;gt;    WindowHeight = 350&amp;lt;br/&amp;gt;    UpperLeftX = 400&amp;lt;br/&amp;gt;    UpperLeftY = 100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #5, _WS_VSCROLL, _WS_MAXIMIZEBOX, _WS_EX_CLIENTEDGE, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #5.0a, &amp;amp;quot;This window has all 3 stylebits applied.&amp;amp;quot;, 20, 10, 260, 40&amp;lt;br/&amp;gt;    Statictext #5.0b, &amp;amp;quot;No removeExtendedBits has been applied.&amp;amp;quot;, 20, 50, 260, 40&amp;lt;br/&amp;gt;    Statictext #5.1, &amp;amp;quot;Stylebits: #1, #2, and #3 combined&amp;amp;quot;, 15, 120, 270, 20&amp;lt;br/&amp;gt;    Statictext #5.2, &amp;amp;quot;Stylebits #5, _WS_VSCROLL, _WS_MAXIMIZEBOX, _WS_EX_CLIENTEDGE, 0&amp;amp;quot;, 15, 160, 270, 60&amp;lt;br/&amp;gt;    Button #5.3, &amp;amp;quot;Close&amp;amp;quot;, [close5], UL, 120, 250&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;removeExtendedBits: No Changes&amp;amp;quot; for Window as #5&amp;lt;br/&amp;gt;    Print #5, &amp;amp;quot;Trapclose [close5]&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #5, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    window5 = 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[close5]&amp;lt;br/&amp;gt;    Close #5&amp;lt;br/&amp;gt;    window5 = 0&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[endDemo]&amp;lt;br/&amp;gt;    If window1 = 1 Then Close #1&amp;lt;br/&amp;gt;    If window2 = 1 Then Close #2&amp;lt;br/&amp;gt;    If window3 = 1 Then Close #3&amp;lt;br/&amp;gt;    If window4 = 1 Then Close #4&amp;lt;br/&amp;gt;    If window5 = 1 Then Close #5&amp;lt;br/&amp;gt;    Close #main&amp;lt;br/&amp;gt;    End&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;This Demo opens up to five independent windows.  The windows
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;will be placed side by side for visual comparison.  The left (primary)
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;window is opened &#039;as is&#039; with no Stylebits assigned.  The
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;right windows show windows with attributes either added
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;or removed by the use of the Stylebits command.
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;This demo requires Liberty BASIC v4.x or greater.
&lt;/span&gt;
    Nomainwin
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; Val(Version$) &amp;lt; 4 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt;
        Notice &lt;span class=&quot;st0&quot;&gt;&amp;quot;This program requires Liberty BASIC V4.0 or greater&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;co1&quot;&gt;&#039;The main (left) window - No stylebits assigned
&lt;/span&gt;    WindowWidth = 300
    WindowHeight = 350
    UpperLeftX = 50
    UpperLeftY = 100
&amp;nbsp;
    Statictext #main.0a, &lt;span class=&quot;st0&quot;&gt;&amp;quot;No Stylebits commands have been used in this window&amp;quot;&lt;/span&gt;, 20, 10, 260, 40
    Statictext #main.0b, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Click on any of the buttons to see Stylebits in action&amp;quot;&lt;/span&gt;, 20, 50, 260, 40
    Button #main.1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;addBits: Vertical Scroll Bar&amp;quot;&lt;/span&gt;, [parameter1], UL, 15, 120, 270, 30
    Button #main.2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;removeBits: Maximize Button&amp;quot;&lt;/span&gt;, [parameter2], UL, 15, 160, 270, 30
    Button #main.3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;addExtendedBits: Sunken Edge Border&amp;quot;&lt;/span&gt;, [parameter3], UL, 15, 200, 270, 30
    Button #main.4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;removeExtendedBits: No Demo&amp;quot;&lt;/span&gt;, [parameter4], UL, 15, 240, 270, 30
    Button #main.5, &lt;span class=&quot;st0&quot;&gt;&amp;quot;See All 3 Stylebits Commands&amp;quot;&lt;/span&gt;, [parameterAll], UL, 15, 280, 270, 30
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;The Window - AS IS&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #main
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [endDemo]&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #main, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Wait
&amp;nbsp;
[parameter1]
    &lt;span class=&quot;co1&quot;&gt;&#039;addBits: Add a vertical scroll bar to the window
&lt;/span&gt;    WindowWidth = 300
    WindowHeight = 350
    UpperLeftX = 400
    UpperLeftY = 100
&amp;nbsp;
    Stylebits #1, _WS_VSCROLL, 0, 0, 0
&amp;nbsp;
    Statictext #1.0a, &lt;span class=&quot;st0&quot;&gt;&amp;quot;A regular window does not normally include a vertical scroll bar.&amp;quot;&lt;/span&gt;, 20, 10, 260, 40
    Statictext #1.0b, &lt;span class=&quot;st0&quot;&gt;&amp;quot;The Stylebits (1st parameter) has ADDED this feature.&amp;quot;&lt;/span&gt;, 20, 50, 260, 40
    Statictext #1.1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;addBits: Vertical Scroll Bar&amp;quot;&lt;/span&gt;, 15, 120, 270, 20
    Statictext #1.2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #1, _WS_VSCROLL, 0, 0, 0&amp;quot;&lt;/span&gt;, 15, 160, 270, 40
    Button #1.3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Close&amp;quot;&lt;/span&gt;, [close1], UL, 120, 250
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;addBits: Vertical Scroll Bar&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #1
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [close1]&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    window1 = 1
&amp;nbsp;
    Wait
&amp;nbsp;
[close1]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #1
    window1 = 0
    Wait
&amp;nbsp;
[parameter2]
    &lt;span class=&quot;co1&quot;&gt;&#039;removeBits: Remove the maximize button
&lt;/span&gt;    WindowWidth = 300
    WindowHeight = 350
    UpperLeftX = 400
    UpperLeftY = 100
&amp;nbsp;
    Stylebits #2, 0, _WS_MAXIMIZEBOX, 0, 0
&amp;nbsp;
    Statictext #2.0a, &lt;span class=&quot;st0&quot;&gt;&amp;quot;A regular window contains a maximize button&amp;quot;&lt;/span&gt;, 20, 10, 260, 40
    Statictext #2.0b, &lt;span class=&quot;st0&quot;&gt;&amp;quot;The Stylebits (2nd parameter) has REMOVED this feature.&amp;quot;&lt;/span&gt;, 20, 50, 260, 40
    Statictext #2.1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;removeBits: Maximize Window&amp;quot;&lt;/span&gt;, 15, 120, 270, 20
    Statictext #2.2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #2, 0, _WS_MAXIMIZEBOX, 0, 0&amp;quot;&lt;/span&gt;, 15, 160, 270, 40
    Button #2.3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Close&amp;quot;&lt;/span&gt;, [close2], UL, 120, 250
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;removeBits: Maximize Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #2
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [close2]&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    window2 = 1
&amp;nbsp;
    Wait
&amp;nbsp;
[close2]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #2
    window2 = 0
    Wait
&amp;nbsp;
[parameter3]
    &lt;span class=&quot;co1&quot;&gt;&#039;addExtendedBits: Add Sunken Edge Border
&lt;/span&gt;    WindowWidth = 300
    WindowHeight = 350
    UpperLeftX = 400
    UpperLeftY = 100
&amp;nbsp;
    Stylebits #3, 0, 0, _WS_EX_CLIENTEDGE, 0
&amp;nbsp;
    Statictext #3.0a, &lt;span class=&quot;st0&quot;&gt;&amp;quot;A regular window has smooth resizable edges.&amp;quot;&lt;/span&gt;, 20, 10, 260, 40
    Statictext #3.0b, &lt;span class=&quot;st0&quot;&gt;&amp;quot;The Stylebits (3rd parameter) has altered the edges.&amp;quot;&lt;/span&gt;, 20, 50, 260, 40
    Statictext #3.1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;addExtendedBits: Sunken Edge Border&amp;quot;&lt;/span&gt;, 15, 120, 270, 20
    Statictext #3.2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #3, 0, 0, _WS_EX_CLIENTEDGE, 0&amp;quot;&lt;/span&gt;, 15, 160, 270, 40
    Button #3.3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Close&amp;quot;&lt;/span&gt;, [close3], UL, 120, 250
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;addExtendedBits: Sunken Edge Border&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #3
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [close3]&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    window3 = 1
&amp;nbsp;
    Wait
&amp;nbsp;
[close3]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #3
    window3 = 0
    Wait
&amp;nbsp;
&amp;nbsp;
[parameter4]
    &lt;span class=&quot;co1&quot;&gt;&#039;removeExtendedBits: No Demo
&lt;/span&gt;    WindowWidth = 300
    WindowHeight = 350
    UpperLeftX = 400
    UpperLeftY = 100
&amp;nbsp;
    Stylebits #4, 0, 0, 0, 0 &lt;span class=&quot;co1&quot;&gt;&#039;No Extended Bits to remove
&lt;/span&gt;
    Statictext #4.0a, &lt;span class=&quot;st0&quot;&gt;&amp;quot;The extended bits are generally added.&amp;quot;&lt;/span&gt;, 20, 10, 260, 40
    Statictext #4.0b, &lt;span class=&quot;st0&quot;&gt;&amp;quot;There is no demo for removing extended bits.&amp;quot;&lt;/span&gt;, 20, 50, 260, 40
    Statictext #4.1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;addExtendedBits: No Demo&amp;quot;&lt;/span&gt;, 15, 120, 270, 20
    Statictext #4.2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #3, 0, 0, 0, 0&amp;quot;&lt;/span&gt;, 15, 160, 270, 40
    Button #4.3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Close&amp;quot;&lt;/span&gt;, [close4], UL, 120, 250
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;removeExtendedBits: No Changes&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #4
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [close4]&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    window4 = 1
&amp;nbsp;
    Wait
&amp;nbsp;
[close4]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #4
    window4 = 0
    Wait
&amp;nbsp;
[parameterAll]
    &lt;span class=&quot;co1&quot;&gt;&#039;All 3 Stylebits Combined in the Same Window
&lt;/span&gt;    WindowWidth = 300
    WindowHeight = 350
    UpperLeftX = 400
    UpperLeftY = 100
&amp;nbsp;
    Stylebits #5, _WS_VSCROLL, _WS_MAXIMIZEBOX, _WS_EX_CLIENTEDGE, 0
&amp;nbsp;
    Statictext #5.0a, &lt;span class=&quot;st0&quot;&gt;&amp;quot;This window has all 3 stylebits applied.&amp;quot;&lt;/span&gt;, 20, 10, 260, 40
    Statictext #5.0b, &lt;span class=&quot;st0&quot;&gt;&amp;quot;No removeExtendedBits has been applied.&amp;quot;&lt;/span&gt;, 20, 50, 260, 40
    Statictext #5.1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits: #1, #2, and #3 combined&amp;quot;&lt;/span&gt;, 15, 120, 270, 20
    Statictext #5.2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #5, _WS_VSCROLL, _WS_MAXIMIZEBOX, _WS_EX_CLIENTEDGE, 0&amp;quot;&lt;/span&gt;, 15, 160, 270, 60
    Button #5.3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Close&amp;quot;&lt;/span&gt;, [close5], UL, 120, 250
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;removeExtendedBits: No Changes&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #5
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #5, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [close5]&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #5, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    window5 = 1
&amp;nbsp;
    Wait
&amp;nbsp;
[close5]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #5
    window5 = 0
    Wait
&amp;nbsp;
[endDemo]
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; window1 = 1 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #1
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; window2 = 1 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #2
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; window3 = 1 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #3
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; window4 = 1 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #4
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; window5 = 1 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #5
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #main
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
It is sometimes desirable to add two or more stylebit parameters.  The window constants can be combined using the logical boolean OR conjunction.  This next demo first opens a normal window, then opens a second window that&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;cannot be maximized: uses the removeBits (2nd parameter) _WS_MAXIMIZEBOX&lt;/li&gt;&lt;li&gt;cannot be minimized: uses the removeBits (2nd parameter) _WS_MINIMIZEBOX&lt;/li&gt;&lt;li&gt;has sunken edge borders: uses the addExtendedBits (3rd parameter) _WS_EX_CLIENTEDGE&lt;/li&gt;&lt;li&gt;stays on top even when not active window: uses the addExtendedBits (3rd parameter) _WS_EX_TOPMOST&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    &#039;This Demo opens up to two independent windows.  The windows&amp;lt;br/&amp;gt;    &#039;will be placed side by side for visual comparison.  The left (primary)&amp;lt;br/&amp;gt;    &#039;window is opened &#039;as is&#039; with no Stylebits assigned.  The&amp;lt;br/&amp;gt;    &#039;right window demonstrates&amp;lt;br/&amp;gt;    &#039;cannot be maximized: uses the removeBits (2nd parameter) _WS_MAXIMIZEBOX&amp;lt;br/&amp;gt;    &#039;cannot be minimized: uses the removeBits (2nd parameter) _WS_MINIMIZEBOX&amp;lt;br/&amp;gt;    &#039;has sunken edge borders: uses the addExtendedBits (3rd parameter) _WS_EX_CLIENTEDGE&amp;lt;br/&amp;gt;    &#039;stays on top even when not active window: uses the addExtendedBits (3rd parameter) _WS_EX_TOPMOST&amp;lt;br/&amp;gt;    &#039;This demo requires Liberty BASIC v4.x or greater.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    If Val(Version$) &amp;amp;lt; 4 Then&amp;lt;br/&amp;gt;        Notice &amp;amp;quot;This program requires Liberty BASIC V4.0 or greater&amp;amp;quot;&amp;lt;br/&amp;gt;        End&amp;lt;br/&amp;gt;    End If&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[noStylebits]&amp;lt;br/&amp;gt;    WindowWidth = 300&amp;lt;br/&amp;gt;    WindowHeight = 350&amp;lt;br/&amp;gt;    UpperLeftX = 50&amp;lt;br/&amp;gt;    UpperLeftY = 100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Statictext #1.1, &amp;amp;quot;No Stylebits commands have been used in this window&amp;amp;quot;, 20, 10, 260, 40&amp;lt;br/&amp;gt;    Statictext #1.2, &amp;amp;quot;Drag this window &#039;over&#039; the second window to see the effects of the&amp;amp;quot;, 20, 110, 260,40&amp;lt;br/&amp;gt;    Statictext #1.3, &amp;amp;quot;_WS_EX_TOPMOST stylebits command&amp;amp;quot;, 20, 150, 260, 40&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;The Window - AS IS&amp;amp;quot; for Window as #1&amp;lt;br/&amp;gt;    Print #1, &amp;amp;quot;Trapclose [close1]&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #1, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    window1 = 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[multipleStylebits]&amp;lt;br/&amp;gt;    WindowWidth = 300&amp;lt;br/&amp;gt;    WindowHeight = 350&amp;lt;br/&amp;gt;    UpperLeftX = 400&amp;lt;br/&amp;gt;    UpperLeftY = 100&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Stylebits #2, 0, _WS_MAXIMIZEBOX or _WS_MINIMIZEBOX, _WS_EX_CLIENTEDGE or _WS_EX_TOPMOST, 0&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    sbText$ = &amp;amp;quot;_WS_MAXIMIZEBOX or _WS_MINIMIZEBOX, _WS_EX_CLIENTEDGE or _WS_EX_TOPMOST, 0&amp;amp;quot;&amp;lt;br/&amp;gt;    Statictext #2.1, &amp;amp;quot;Try to Maximize or Minimize this Window&amp;amp;quot;, 20, 10, 260, 40&amp;lt;br/&amp;gt;    Statictext #2.2, &amp;amp;quot;Click and drag this window around.&amp;amp;quot;, 20, 50, 260, 40&amp;lt;br/&amp;gt;    Statictext #2.3, &amp;amp;quot;Notice the sunken border edges.&amp;amp;quot;, 20, 90, 260, 40&amp;lt;br/&amp;gt;    Statictext #2.4, &amp;amp;quot;Stylebits #2, &amp;amp;quot;;sbText$, 15, 160, 260, 80&amp;lt;br/&amp;gt;    Statictext #2.5, &amp;amp;quot;2 or more parameters joined with OR&amp;amp;quot;, 15, 260, 260, 40&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Combining Stylebits Parameters Using OR&amp;amp;quot; for Window as #2&amp;lt;br/&amp;gt;    Print #2, &amp;amp;quot;Trapclose [close2]&amp;amp;quot;&amp;lt;br/&amp;gt;    Print #2, &amp;amp;quot;Font Times_New_Roman 12 Bold&amp;amp;quot;&amp;lt;br/&amp;gt;    window2 = 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[close1]&amp;lt;br/&amp;gt;    Close #1&amp;lt;br/&amp;gt;    window1 = 0&amp;lt;br/&amp;gt;    If window2 = 0 Then End&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[close2]&amp;lt;br/&amp;gt;    Close #2&amp;lt;br/&amp;gt;    window2 = 0&amp;lt;br/&amp;gt;    If window1 = 0 Then End&amp;lt;br/&amp;gt;    Wait&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;This Demo opens up to two independent windows.  The windows
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;will be placed side by side for visual comparison.  The left (primary)
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;window is opened &#039;as is&#039; with no Stylebits assigned.  The
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;right window demonstrates
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;cannot be maximized: uses the removeBits (2nd parameter) _WS_MAXIMIZEBOX
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;cannot be minimized: uses the removeBits (2nd parameter) _WS_MINIMIZEBOX
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;has sunken edge borders: uses the addExtendedBits (3rd parameter) _WS_EX_CLIENTEDGE
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;stays on top even when not active window: uses the addExtendedBits (3rd parameter) _WS_EX_TOPMOST
&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;&#039;This demo requires Liberty BASIC v4.x or greater.
&lt;/span&gt;
    Nomainwin
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; Val(Version$) &amp;lt; 4 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt;
        Notice &lt;span class=&quot;st0&quot;&gt;&amp;quot;This program requires Liberty BASIC V4.0 or greater&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt;
&amp;nbsp;
[noStylebits]
    WindowWidth = 300
    WindowHeight = 350
    UpperLeftX = 50
    UpperLeftY = 100
&amp;nbsp;
    Statictext #1.1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;No Stylebits commands have been used in this window&amp;quot;&lt;/span&gt;, 20, 10, 260, 40
    Statictext #1.2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Drag this window &#039;over&#039; the second window to see the effects of the&amp;quot;&lt;/span&gt;, 20, 110, 260,40
    Statictext #1.3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;_WS_EX_TOPMOST stylebits command&amp;quot;&lt;/span&gt;, 20, 150, 260, 40
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;The Window - AS IS&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #1
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [close1]&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    window1 = 1
&amp;nbsp;
[multipleStylebits]
    WindowWidth = 300
    WindowHeight = 350
    UpperLeftX = 400
    UpperLeftY = 100
&amp;nbsp;
    Stylebits #2, 0, _WS_MAXIMIZEBOX &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _WS_MINIMIZEBOX, _WS_EX_CLIENTEDGE &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _WS_EX_TOPMOST, 0
&amp;nbsp;
    sbText$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;_WS_MAXIMIZEBOX or _WS_MINIMIZEBOX, _WS_EX_CLIENTEDGE or _WS_EX_TOPMOST, 0&amp;quot;&lt;/span&gt;
    Statictext #2.1, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Try to Maximize or Minimize this Window&amp;quot;&lt;/span&gt;, 20, 10, 260, 40
    Statictext #2.2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Click and drag this window around.&amp;quot;&lt;/span&gt;, 20, 50, 260, 40
    Statictext #2.3, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Notice the sunken border edges.&amp;quot;&lt;/span&gt;, 20, 90, 260, 40
    Statictext #2.4, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Stylebits #2, &amp;quot;&lt;/span&gt;;sbText$, 15, 160, 260, 80
    Statictext #2.5, &lt;span class=&quot;st0&quot;&gt;&amp;quot;2 or more parameters joined with OR&amp;quot;&lt;/span&gt;, 15, 260, 260, 40
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Combining Stylebits Parameters Using OR&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #2
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose [close2]&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; #2, &lt;span class=&quot;st0&quot;&gt;&amp;quot;Font Times_New_Roman 12 Bold&amp;quot;&lt;/span&gt;
    window2 = 1
&amp;nbsp;
    Wait
&amp;nbsp;
[close1]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #1
    window1 = 0
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; window2 = 0 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
    Wait
&amp;nbsp;
[close2]
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #2
    window2 = 0
    &lt;span class=&quot;kw3&quot;&gt;If&lt;/span&gt; window1 = 0 &lt;span class=&quot;kw3&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
    Wait&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;br /&gt;
Stylebits, of both dwStyle and dwExStyle, can be assigned to other types of windows and most controls (buttons, textboxes, listboxes, statictext, etc.).  Texteditors are not readily modifiable with Stylebits.  The helpfile states that &lt;em&gt;since the texteditor is not a native Windows control you will only be able to do things like tweak its border and perhaps a few other things&lt;/em&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;x-Defining the Window-A List of Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;A List of Stylebits&lt;/h3&gt;
&lt;br /&gt;
You can get a list of all &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632600(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwStyles&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;dwExStyles&lt;/a&gt; available with the Stylebits command at the MSDN Library.</description>
          </item>
    <item>
      <title>StylebitsWindowsConstants</title>
      <link>https://lbpe.wikispaces.com/StylebitsWindowsConstants</link>
      <dc:creator>JanetTerra</dc:creator>
      <guid isPermaLink="true">https://lbpe.wikispaces.com/StylebitsWindowsConstants</guid>
      <comments>https://lbpe.wikispaces.com/page/messages/StylebitsWindowsConstants</comments>
      <pubDate>Fri, 27 Aug 2010 02:12:34 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x-Stylebits and Windows Constants&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;Stylebits and Windows Constants&lt;/h2&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc1&quot;&gt;&lt;a name=&quot;x-Stylebits and Windows Constants-Janet Terra&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;Janet Terra&lt;/h3&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;x-Stylebits and Windows Constants-Recognized Windows Constants&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;&lt;em&gt;Recognized Windows Constants&lt;/em&gt;&lt;/h3&gt;
&lt;br /&gt;
Many of the Windows constants are recognized by Liberty BASIC by preceding that constant with an &lt;tt&gt;underscore&lt;/tt&gt;.  As an example, the &lt;tt&gt;decimal equivalent&lt;/tt&gt; of &lt;strong&gt;WS_EX_TOOLWINDOW&lt;/strong&gt; (&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;MSDN Defines a Tool Window here)&lt;/a&gt; is &lt;strong&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.jniwrapper.com/jniwrapper_downloads/javadoc/winpack/constant-values.html&quot; rel=&quot;nofollow&quot;&gt;128&lt;/a&gt;&lt;/strong&gt;.  With the preceding underscore, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasic.com&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC&lt;/a&gt; accurately interprets that &lt;tt&gt;constant&lt;/tt&gt;.&lt;br /&gt;
&lt;hr /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Print _WS_EX_TOOLWINDOW &#039; Prints 128&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; _WS_EX_TOOLWINDOW &#039; Prints 128&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;hr /&gt;
While it is most convenient to use the Windows &lt;tt&gt;constant&lt;/tt&gt; itself, the &lt;tt&gt;numerical equivalent&lt;/tt&gt; (either the literal or a variable) can be used just as easily in the Stylebits command.&lt;br /&gt;
&lt;hr /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Stylebits 0, 0, _WS_EX_TOOLWINDOW, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Stylebits 0, 0, _WS_EX_TOOLWINDOW, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;is the same as&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Stylebits 0, 0, 128, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Stylebits 0, 0, 128, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;is the same as&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    exStyle = 128&amp;lt;br/&amp;gt;    Stylebits 0, 0, exStyle, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    exStyle = 128
    Stylebits 0, 0, exStyle, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;hr /&gt;
&lt;br /&gt;
This variable must be in &lt;tt&gt;decimal&lt;/tt&gt; (not hexademical) form.  If necesssary, use the Liberty BASIC HexDec() function to convert a &lt;tt&gt;hexademical&lt;/tt&gt; value to a &lt;tt&gt;decimal&lt;/tt&gt; value.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    valueHex$ = &amp;amp;quot;80&amp;amp;quot; &#039; Hexademical &amp;amp;amp;H80&amp;lt;br/&amp;gt;    Print HexDec(valueHex$) &#039; Prints 128&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    valueHex$ = &lt;span class=&quot;st0&quot;&gt;&amp;quot;80&amp;quot;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;&#039; Hexademical &amp;amp;H80
&lt;/span&gt;    &lt;span class=&quot;kw4&quot;&gt;Print&lt;/span&gt; HexDec(valueHex$) &#039; Prints 128&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;hr /&gt;
Demo 1: Opening a Tool Window using the Windows Constant in the Stylebits command&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;&#039; Open a Tool Window&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    Stylebits #w, 0, 0, _WS_EX_TOOLWINDOW, 0&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Tool Window&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w &amp;amp;quot;Trapclose QuitDemo&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub QuitDemo handle$&amp;lt;br/&amp;gt;    Close #handle$&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Open a Tool Window
&lt;/span&gt;
    Nomainwin
    Stylebits #w, 0, 0, _WS_EX_TOOLWINDOW, 0
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Tool Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose QuitDemo&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Wait
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; QuitDemo handle$
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #handle$
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;hr /&gt;
Demo 2: Opening a Tool Window using the literal decimal value in the Stylebits command&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;&#039; Open a Tool Window&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    Stylebits #w, 0, 0, 128, 0&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Tool Window&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w &amp;amp;quot;Trapclose QuitDemo&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub QuitDemo handle$&amp;lt;br/&amp;gt;    Close #handle$&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Open a Tool Window
&lt;/span&gt;
    Nomainwin
    Stylebits #w, 0, 0, 128, 0
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Tool Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose QuitDemo&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Wait
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; QuitDemo handle$
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #handle$
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;hr /&gt;
Demo 3: Opening a Tool Window using a variable in the Stylebits command&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;&#039; Open a Tool Window&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Nomainwin&amp;lt;br/&amp;gt;    exStyle = 128&amp;lt;br/&amp;gt;    Stylebits #w, 0, 0, exStyle, 0&amp;lt;br/&amp;gt;    Open &amp;amp;quot;Tool Window&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w &amp;amp;quot;Trapclose QuitDemo&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub QuitDemo handle$&amp;lt;br/&amp;gt;    Close #handle$&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;&lt;span class=&quot;co1&quot;&gt;&#039; Open a Tool Window
&lt;/span&gt;
    Nomainwin
    exStyle = 128
    Stylebits #w, 0, 0, exStyle, 0
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Tool Window&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose QuitDemo&amp;quot;&lt;/span&gt;
&amp;nbsp;
    Wait
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; QuitDemo handle$
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #handle$
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;hr /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x-Stylebits and Windows Constants-Unrecognized Windows Constants&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;&lt;em&gt;Unrecognized Windows Constants&lt;/em&gt;&lt;/h3&gt;
&lt;br /&gt;
There are well over 55,000 Windows Constants in use.  Many, but not all, Windows constants are recognized by Liberty BASIC.  &lt;strong&gt;WS_EX_LAYERED&lt;/strong&gt; is one of the unrecognized constants.  Due to the very number of entries alone, a comprehensive list of such constants would be near impossible to find.  In the case of the unrecognized &lt;strong&gt;WS_EX_LAYERED&lt;/strong&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.google.com/&quot; rel=&quot;nofollow&quot;&gt;Google&lt;/a&gt; that constant to find the &lt;tt&gt;decimal&lt;/tt&gt; or &lt;tt&gt;hexadecimal&lt;/tt&gt; equivalent.  Remember, if the &lt;tt&gt;constant value&lt;/tt&gt; is given as a &lt;tt&gt;hexadecimal string&lt;/tt&gt;, you must convert that hexadecimal string to the equivalent &lt;tt&gt;decimal number&lt;/tt&gt;.  The decimal equivalent of &lt;strong&gt;WS_EX_LAYERED&lt;/strong&gt; is &lt;strong&gt;524288&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
It is best to choose a meaningful variable name.  In this case, we&#039;ll name the variable &lt;strong&gt;WS.EX.LAYERED&lt;/strong&gt;.  Liberty BASIC will halt with an error when trying to use an unrecognized Windows constant&lt;br /&gt;
&lt;hr /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Stylebits #w, 0, 0, _WS_EX_LAYERED, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Stylebits #w, 0, 0, _WS_EX_LAYERED, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;but will happilly accept either&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Stylebits #w, 0, 0, 524288, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Stylebits #w, 0, 0, 524288, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;or&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    WS.EX.LAYERED = 524288&amp;lt;br/&amp;gt;    Stylebits #w, 0, 0, WS.EX.LAYERED, 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    WS.EX.LAYERED = 524288
    Stylebits #w, 0, 0, WS.EX.LAYERED, 0&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;&lt;hr /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;x-Stylebits and Windows Constants-Combining Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;&lt;em&gt;Combining Stylebits&lt;/em&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lbpe.wikispaces.com/Stylebits+-+Windows&quot;&gt;Stylebits - Windows&lt;/a&gt; shows how to combine two or more Windows constants within the same addbits, removebits, addextendedbits or removeextendedbits of the Stylebits command.  Decimal numbers and variables work just as well in combination.&lt;br /&gt;
&lt;hr /&gt;
Demo1: Removing the Maximize and Minimize Buttons using Windows Constants in the Stylebits command&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    Stylebits #w, 0, _WS_MAXIMIZEBOX or _WS_MINIMIZEBOX, 0, 0&amp;lt;br/&amp;gt;    Open &amp;amp;quot;No Max/Min Boxes&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w &amp;amp;quot;Trapclose QuitDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub QuitDemo handle$&amp;lt;br/&amp;gt;    Close #handle$&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    Stylebits #w, 0, _WS_MAXIMIZEBOX &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; _WS_MINIMIZEBOX, 0, 0
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;No Max/Min Boxes&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose QuitDemo&amp;quot;&lt;/span&gt;
    Wait
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; QuitDemo handle$
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #handle$
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;Demo2: Removing the Maximize and Minimize Buttons using literals and variables in the Stylebits command&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;vb&amp;quot;&amp;gt;    WS.MAXIMIZEBOX = 65536&amp;lt;br/&amp;gt;    Stylebits #w, 0, 131072 or WS.MAXIMIZEBOX, 0, 0&amp;lt;br/&amp;gt;    Open &amp;amp;quot;No Max/Min Boxes&amp;amp;quot; for Window as #w&amp;lt;br/&amp;gt;    #w &amp;amp;quot;Trapclose QuitDemo&amp;amp;quot;&amp;lt;br/&amp;gt;    Wait&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Sub QuitDemo handle$&amp;lt;br/&amp;gt;    Close #handle$&amp;lt;br/&amp;gt;    End&amp;lt;br/&amp;gt;End Sub&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.vb  {font-family:monospace;}
.vb .imp {font-weight: bold; color: red;}
.vb .kw1 {color: #F660AB; font-weight: bold;}
.vb .kw2 {color: #E56717; font-weight: bold;}
.vb .kw3 {color: #8D38C9; font-weight: bold;}
.vb .kw4 {color: #151B8D; font-weight: bold;}
.vb .kw5 {color: #00C2FF; font-weight: bold;}
.vb .kw6 {color: #3EA99F; font-weight: bold;}
.vb .co1 {color: #008000;}
.vb .es0 {color: #800000; font-weight: bold;}
.vb .st0 {color: #800000;}
.vb span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;vb&quot;&gt;    WS.MAXIMIZEBOX = 65536
    Stylebits #w, 0, 131072 &lt;span class=&quot;kw3&quot;&gt;or&lt;/span&gt; WS.MAXIMIZEBOX, 0, 0
    &lt;span class=&quot;kw4&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;No Max/Min Boxes&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt; Window &lt;span class=&quot;kw4&quot;&gt;as&lt;/span&gt; #w
    #w &lt;span class=&quot;st0&quot;&gt;&amp;quot;Trapclose QuitDemo&amp;quot;&lt;/span&gt;
    Wait
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt; QuitDemo handle$
    &lt;span class=&quot;kw3&quot;&gt;Close&lt;/span&gt; #handle$
    &lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;&lt;hr /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:23:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;x-Stylebits and Windows Constants-Beyond Stylebits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:23 --&gt;&lt;em&gt;Beyond Stylebits&lt;/em&gt;&lt;/h3&gt;
&lt;br /&gt;
Windows constants can be applied in many other coding situations.  One example is passing parameters to a CallDLL #gdi32. Windows constants for opaque and transparent background colors are &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.jniwrapper.com/jniwrapper_downloads/javadoc/winpack/constant-values.html&quot; rel=&quot;nofollow&quot;&gt;BKMODE_OPAQUE&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.jniwrapper.com/jniwrapper_downloads/javadoc/winpack/constant-values.html&quot; rel=&quot;nofollow&quot;&gt;BKMODE_TRANSPARENT&lt;/a&gt; respectively.  Since neither of these constants is recognized by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasic.com&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC&lt;/a&gt;, then the value of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.jniwrapper.com/jniwrapper_downloads/javadoc/winpack/constant-values.html&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt; or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.jniwrapper.com/jniwrapper_downloads/javadoc/winpack/constant-values.html&quot; rel=&quot;nofollow&quot;&gt;2&lt;/a&gt; must be passed into any CallDLL #gdi32 as either a literal or a variable.  &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasic.com&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC&lt;/a&gt; sees Windows constants as &lt;em&gt;&lt;strong&gt;Global variables&lt;/strong&gt;&lt;/em&gt;.  It may be beneficial use the &lt;em&gt;&lt;strong&gt;Global&lt;/strong&gt;&lt;/em&gt; command when specifying any user defined variable such as &lt;tt&gt;BKMODE.TRANSPARENT&lt;/tt&gt;.  The information here can be applied to many other circumstances when the Windows constant is unrecognized by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.libertybasic.com&quot; rel=&quot;nofollow&quot;&gt;Liberty BASIC&lt;/a&gt; and the decimal value is known to the programmer.</description>
          </item>

  </channel>
</rss>