a="你要输入的数字"
text1.text=text1.text & a
+++++++++++
例子:
for i=0 to 9
text1.text=text1.text & i
next
结果:0123456789

解决方案 »

  1.   

    如果你想做一个计数器的话你用10个command控件分别把它们的caption设为0到9然后在各个command的click事件中加入代码
    Text1.Text =  Command2.Caption & Text1.Text
    就可以了
      

  2.   

    由于匆忙上面代码写的不太合适应该写成:
    Text1.Text = Text1.Text & Commandi.Caption
      

  3.   

    Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
    KeyAscii = 0
    ElseIf (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
      KeyAscii = 0
    End If
    End Sub
      

  4.   

    這個問題很簡單,但也有時需提防。因為目前windows的程序設計都為焦點觸發類,當焦點移至text1控件時,自然樓上的朋友代碼再擴充一下即是可行,但如果你之焦點移至其它控件上時,則此時相應你也是想實現同樣的I/0功能,如此就需在該控件之_keypress事件中加入同樣的代碼方可實現,不信你試試。
      

  5.   

    agree with  forest_sea(海)