Microsoft Forms 2.0 Object Library控件组里的combobox,百思不得其解

lovebeethoven 2004-08-07 01:22:04
我在窗体里用了一个COMBOBOX控件,当我给他的TEXT属性赋值的时候,就会触发他的CLICK事件,可我在另一个工程里不触发这个事件啊,为什么?
还有它提供的TEXT和VALUE属性有什么区别?
...全文
246 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lovebeethoven 2004-08-07
  • 打赏
  • 举报
回复
是啊,我也发现了,如 rainstormmaster(暴风雨 v2.0) 兄所说,如果输入内容是列表内的内容就触发,不好用,不用了:(
hhjjhjhj 2004-08-07
  • 打赏
  • 举报
回复
///////还有它提供的TEXT和VALUE属性有什么区别?///////
Private Sub Form_Load()
With Me.ComboBox1
.ColumnCount = 3
.BoundColumn = 2
.AddItem "a"
.AddItem "b"
.AddItem "c"
.Column(1, 0) = 1
.Column(1, 1) = 2
.Column(1, 2) = 3
End With
End Sub
'选中一条后测试
Private Sub Command1_Click()
MsgBox Me.ComboBox1.Text
MsgBox Me.ComboBox1.Value
End Sub
rainstormmaster 2004-08-07
  • 打赏
  • 举报
回复
这个和你设定的内容有关:
如果设定的text是list的一个条目的内容则触发,否则不触发,如:
Option Explicit

Private Sub Command1_Click() '触发
ComboBox1.Text = "line 1"
End Sub



Private Sub ComboBox1_Click()
MsgBox "aa"
End Sub

Private Sub Command2_Click() '不触发
ComboBox1.Text = "test"
End Sub

Private Sub Form_Load()
Dim i As Long
For i = 1 To 40
ComboBox1.AddItem "line " + CStr(i)
Next
End Sub
lovebeethoven 2004-08-07
  • 打赏
  • 举报
回复
没人用过吗?
1 , vb5dialog.zipThis demonstrates how to subclass the Common Dialog Dialogs and manipulate a specific Dialog.2 , cpnl.zipForm_Taskbar is a control for Visual Basic which, once placed onto a form, makes the form act like the Taskbar (minus the Start Menu).3 , vbo_progbar.zipImplement a common control progress bar with added features that are not accessable using COMCTL32.OCX! 4 , vbo_infolabel.zipThis control adds a great user-friendly interface with and icon and "Hover" ability. Based on a control seen in ICQ. 5 , vbo_checkcombo.zipAdd a checkbox to a combo box and use it to enabled/disable the combo! or whatever you would like to do with it! 6 , vbo_controlframe.zipCreate your own system button such as a Maximize, Minimize, Close, and many others with ease! 7 , vbo_ctextbox.zipThis class makes using the Textbox or Edit class API simple. Easily set properties and access many features not available directly from VB. 8 , taskbar.zipForm_Taskbar is a control for Visual Basic which, once placed onto a form, makes the form act like the Taskbar (minus the Start Menu).9 , NT_Service.zipThis is an OCX that allows you to create an NT service application...add the control to your project and register it as a service!!10 , Scroller.zipThis is a Control Container, it's like a frame control but it lets you scroll the content up and down...11 , TrayArea.zipThis control lets you add your icon to the System Tray Area and handle some events such as MouseMove, MouseDown, MouseUp and DblClick.12 , Resizer.zipThis is a very useful control: It's a container control, you can insert two controls inside and then you'll have a vertical (or horizontal) resizer bar (like the Windows File Explorer). A resizer can contain another resizer... an so on. (you can divide you form in as many sizable sections as you want...).13 , Label3D.zipTh

1,453

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧