企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
<p><span style="font-weight:700;"><span style="font-size:16px;">Enabled属性</span></span></p> <p><span style="line-height:1.78571;">这个属性返回或设置一个值</span>,确定窗体或控件是否可以响应用户生成的事件。</p> <p class="label" style="font-size:12px;">语法</p> <p><span class="emp"><i>object</i></span>.<b>Enabled</b>[ =&nbsp;<span class="emp"><i>boolean</i></span>]</p> <p><b>Enabled</b>属性的语法包含下面部分:</p> <table class="MsoNormalTable" border="1" cellpadding="0" style="width:650px;"><tbody><tr><td width="29%" valign="top"><p class="MsoNormal"><span style="font-weight:700;"><span style="font-size:9pt;font-family:宋体;">部分</span></span><span style="font-size:9pt;font-family:宋体;"></span></p> </td> <td width="71%" valign="top"><p class="MsoNormal"><span style="font-weight:700;"><span style="font-size:9pt;font-family:宋体;">描述</span></span><span style="font-size:9pt;font-family:宋体;"></span></p> </td> </tr> <tr><td width="29%" valign="top"><p class="MsoNormal"><span class="emp"><i><span style="font-size:9pt;">object</span></i></span><span style="font-size:9pt;font-family:宋体;"></span></p> </td> <td width="71%" valign="top"><p class="MsoNormal">对象表达式,其值是“应用于”列表中的一个对象。</p> </td> </tr> <tr><td width="29%" valign="top"><p class="MsoNormal"><span class="emp"><i><span style="font-size:9pt;">boolean</span></i></span><span style="font-size:9pt;font-family:宋体;"></span></p> </td> <td width="71%" valign="top"><p class="MsoNormal">一个布尔表达式,指定对象是否可以响应用户生成的事件。</p> </td> </tr> </tbody> </table> <p class="MsoNormal">&nbsp;</p> <p class="label" style="font-size:12px;">设置值</p> <p><span class="emp"><i>boolean</i></span>的设置值是:</p> <table class="MsoNormalTable" border="1" cellpadding="0" width="100%" style="width:650px;"><tbody><tr><td width="29%" valign="top"><p class="MsoNormal"><span style="font-weight:700;"><span style="font-size:9pt;font-family:宋体;">常数</span></span><span style="font-size:9pt;font-family:宋体;"></span></p> </td> <td width="8%" valign="top"><p class="MsoNormal"><span style="font-weight:700;"><span style="font-size:9pt;font-family:宋体;">值</span></span><span style="font-size:9pt;font-family:宋体;"></span></p> </td> <td width="61%" valign="top"><p class="MsoNormal"><span style="font-weight:700;"><span style="font-size:9pt;font-family:宋体;">描述</span></span><span style="font-size:9pt;font-family:宋体;"></span></p> </td> </tr> <tr><td width="29%" valign="top"><span><span style="font-size:12px;line-height:18.4615px;">真</span></span></td> <td width="8%" valign="top"><p class="MsoNormal"><span style="font-size:9pt;font-family:宋体;">-1</span><span style="font-size:9pt;font-family:宋体;"></span></p> </td> <td width="61%" valign="top"><p class="MsoNormal">(默认)允许对象响应事件</p> </td> </tr> <tr><td width="29%" valign="top"><span><span style="font-size:12px;line-height:18.4615px;">假</span></span></td> <td width="8%" valign="top"><p class="MsoNormal"><span style="font-size:9pt;font-family:宋体;">0</span><span style="font-size:9pt;font-family:宋体;"></span></p> </td> <td width="61%" valign="top"><p class="MsoNormal"><span style="font-size:9pt;font-family:宋体;"><span style="color:#2A2A2A;font-family:'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;font-size:13px;line-height:17.55px;">不可用</span></span><span style="font-size:9pt;font-family:宋体;"></span></p> </td> </tr> </tbody> </table> <p class="MsoNormal">&nbsp;</p> <p class="label" style="font-size:12px;">说明</p> <p>该启用属性允许启用或在运行时禁用对象。例如,您可以禁用不适用于应用程序当前状态的对象。您还可以禁用纯粹用于显示目的的控件,例如提供只读信息的文本框。</p> <p><span style="font-weight:700;"></span><span style="font-weight:700;"></span><span style="font-weight:700;"></span><span style="font-weight:700;"></span><span style="font-weight:700;"></span></p> <pre class="prettyprint lang-vb">Private Sub ChkEnabled_AfterUpdate() &nbsp; &nbsp; TreeView0.Enabled = Me.ChkEnabled End Sub </pre> <div><br /> </div>