try this
所在版块:求学狮城 发贴时间:2003-03-09 19:53  评分:

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
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.
 相关帖子 我要回复↙ ↗回到正文
问一个关于VB的问题 澳洲野狗   (269 bytes , 364reads )
try this flybird111   (644 bytes , 182reads )
试一下这样写 瞌睡虫   (70 bytes , 184reads )
能不能这样写? 澳洲野狗   (179 bytes , 173reads )
i tried ,cannot:( 澳洲野狗   (0 bytes , 128reads )