问一个关于VB的问题
登录 | 论坛导航 -> 华新鲜事 -> 求学狮城 | 本帖共有 5 楼,当前显示第 5 楼 : 从楼主开始阅读 : 本帖树形列表 : 返回上一页
作者:flybird111 (等级:3 - 略知一二,发帖:1320) 发表:2003-03-09 19:53:36  5楼  评分: 
try this
first place one textbox and combobox on the form. name them text1 and combo1 respectively.....


Private Sub Form_Load()
Combo1.Clear

Combo1.AddItem "AAA"
Combo1.AddItem "BBB"
Combo1.AddItem "CCC"
Combo1.AddItem "DDD"

End Sub

Private Sub Combo1_Click()
Text1.Text = Combo1.Text
End Sub


or u can try this



Private Sub text1_gotfocus()
If Combo1.Text = "" Then
MsgBox "Please select a value from the list first."
Combo1.SetFocus
Exit Sub
Else
Text1.Text = Combo1.Text
End If
End Sub


Private Sub Form_Load()
Combo1.Clear

Combo1.AddItem "AAA"
Combo1.AddItem "BBB"
Combo1.AddItem "CCC"
Combo1.AddItem "DDD"

End Sub


Stray birds of summer come to my window to sing and fly away. And yellow leaves of autumn, which have no songs, flutter and fall there with a sign.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表

本帖共有 5 楼,当前显示第 5 楼,本文还有 N-1 层楼,要不你试试看:点击此处阅读更多 >>



请登录后回复:帐号   密码