<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do set the ReadOnly attribute of a combo box in vbs? in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/how-do-set-the-readonly-attribute-of-a-combo-box/m-p/459904#M3294</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Without testing myself...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Control object does not have a property of "ReadOnly".&amp;nbsp; The property you would be looking for is "Enabled".&amp;nbsp; Controls with Enabled = True can be edited, those with Enabled = False will be grayed out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Still, you'd need some additional changes besides this.&amp;nbsp; I don't believe that while in a checkbox control you can get to the ThisEvent.Object.Pages().Control() property.&amp;nbsp; You've got to get back out to it's parent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would try something like this during the onclick event of the checkbox control:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Dim myvalue myvalue = ThisEvent.Object.Value&amp;nbsp; If myvalue = "True" Then ThisEvent.Object.Parent.Parent.Pages("PAGE1").Controls("domComboBox").Enabled = True&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You would probably need to set the default value for the checkbox to "False" so that it opens unchecked.&amp;nbsp; Also, if you wanted to enable the ComboBox with a checkbox value of True, you should probably set the state of the combobox to be read-only by default.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Apr 2012 18:07:40 GMT</pubDate>
    <dc:creator>TimHopper</dc:creator>
    <dc:date>2012-04-25T18:07:40Z</dc:date>
    <item>
      <title>How do set the ReadOnly attribute of a combo box in vbs?</title>
      <link>https://community.esri.com/t5/arcpad-questions/how-do-set-the-readonly-attribute-of-a-combo-box/m-p/459903#M3293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a checkbox control that when activated (value=true) would change a combo box from read-only to editable (readonly=false).&amp;nbsp; I am initiating this event through the OnClick event of the Editform checkbox (chkMort).&amp;nbsp; My code thus far is simply:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;----&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sub Mort&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim MortPg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Set MortPg = objEditForm.Pages("page2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If MortPg.Controls("chkMort").Value = True Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; MortPg.Controls("cboMort").ReadOnly = False&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; MortPg.Controls("cboMort").ReadOnly = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;----&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I am obviously getting the syntax wrong with the ReadOnly attribute. I cannot find an example anywhere on how to make this syntax correct, can anyone help me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 15:58:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/how-do-set-the-readonly-attribute-of-a-combo-box/m-p/459903#M3293</guid>
      <dc:creator>MikeRadko</dc:creator>
      <dc:date>2012-04-25T15:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do set the ReadOnly attribute of a combo box in vbs?</title>
      <link>https://community.esri.com/t5/arcpad-questions/how-do-set-the-readonly-attribute-of-a-combo-box/m-p/459904#M3294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Without testing myself...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Control object does not have a property of "ReadOnly".&amp;nbsp; The property you would be looking for is "Enabled".&amp;nbsp; Controls with Enabled = True can be edited, those with Enabled = False will be grayed out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Still, you'd need some additional changes besides this.&amp;nbsp; I don't believe that while in a checkbox control you can get to the ThisEvent.Object.Pages().Control() property.&amp;nbsp; You've got to get back out to it's parent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would try something like this during the onclick event of the checkbox control:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Dim myvalue myvalue = ThisEvent.Object.Value&amp;nbsp; If myvalue = "True" Then ThisEvent.Object.Parent.Parent.Pages("PAGE1").Controls("domComboBox").Enabled = True&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You would probably need to set the default value for the checkbox to "False" so that it opens unchecked.&amp;nbsp; Also, if you wanted to enable the ComboBox with a checkbox value of True, you should probably set the state of the combobox to be read-only by default.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 18:07:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/how-do-set-the-readonly-attribute-of-a-combo-box/m-p/459904#M3294</guid>
      <dc:creator>TimHopper</dc:creator>
      <dc:date>2012-04-25T18:07:40Z</dc:date>
    </item>
  </channel>
</rss>

