6218.html
来自「VB技巧问答10000例,是一个教程」· HTML 代码 · 共 23 行
HTML
23 行
<html>
<head>
<title>Re: 不可能</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>Re: 不可能</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by Kent on October 02, 1998 at 22:33:23:<p>
In Reply to: <a href="5831.html">不可能</a> posted by 小吴 on September 21, 1998 at 07:37:13:<p>
: 1. 动态新增非控制项阵列的控制项在 vb6 (含) 以前只能使用 API,VB6 尚不能确定。<br>: 2. 不管是何种版本,何种语言,都不可能达到你要的功能。<p>>其实vb6.0已经可以达到你要的功能了,如下<br>用WithEvents可以写此control的事件<br>Private WithEvents btnObj As CommandButton<p>Private Sub btnObj_Click()<br> MsgBox "This is a dynamically added button."<br>End Sub<br>Private Sub Form_Load()<br> Set btnObj = Controls.Add("VB.CommandButton", "btnObj")<br> With btnObj<br> .Visible = True<br> .Width = 2000<br> .Caption = "Hello"<br> .Top = 1000<br> .Left = 1000<br> End With<br>End Sub<p>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 6218-->
</ul><!--end: 6218-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?