多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
<p><span style="font-weight:700;"><span style="font-size:16px;">Container 属性</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>set object</i></span>.<b>Container</b>[ = <i>Container</i>]</p> <p><span style="font-weight:700;"><span style="font-weight:700;"><span style="font-weight:700;">Container</span></span></span>属性的语法包含下面部分:</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;"><i>Container</i></span></i></span></p> </td> <td width="71%" valign="top"><p class="MsoNormal">一个对象表达式,其计算结果可以充当其他控件的容器</p> </td> </tr> </tbody> </table> <p class="MsoNormal"><br /> </p> <p class="label" style="font-size:12px;">说明</p> <p><br /> </p> <p style="color:#2A2A2A;font-family:'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;font-size:13px;">以下控件可以包含其他控件:</p> <ul style="color:#000000;font-family:'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;font-size:13px;"><li><b>Frame控件</b></li> <li><b>PictureBox</b><span class="">控件</span></li> <li><b>SSTab控件</b></li> </ul> <h4 class="dtH4" style="color:#000000;font-size:1.077em;font-family:'Segoe UI Semibold', 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;font-weight:normal;">例</h4> <p style="color:#2A2A2A;font-family:'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;font-size:13px;">此示例演示如何将<b>CommandButton</b>控件从容器移动到<b>窗体</b>对象的容器。</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 Form_Click() &nbsp; &nbsp;Static intX As Integer &nbsp; &nbsp;Select Case intX &nbsp; &nbsp; &nbsp; Case 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Set Command1.Container = Picture1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Command1.Top= 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Command1.Left= 0 &nbsp; &nbsp; &nbsp; Case 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Set Command1.Container = Frame1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Command1.Top= 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Command1.Left= 0 &nbsp; &nbsp; &nbsp; Case 2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Set Command1.Container = Form1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Command1.Top= 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Command1.Left= 0 &nbsp; &nbsp;End Select &nbsp; &nbsp;intX = intX + 1 End Sub </pre> <div><br /> </div>