VB文本框问题 求教! 谢。
Vb文本框问题,请教下高手 我的想法是 调用文本框输入"X" 并保留当前行 在调用输入时显示在第2行第3行...
Option Explicit Private Sub cmdGo_Click() Dim Temp As String Temp = Trim(txtInput.Text) If txtInput.Text <> "" Then If txtCommon.Text = "" Then txtCommon.Text = Temp Else txtCommon.Text = txtCommon.Text & vbCrLf & Temp End If End If Temp = "": txtInput.Text = "" End Sub Private Sub Form_Load() txtInput.Text = "": txtInput.TabIndex = 0 cmdGo.TabIndex = 1 txtCommon.Text = "": txtCommon.TabIndex = 2 End Sub
Option Explicit Dim CodeString() As String, iCoint As Long Private Sub cmdGo_Click() Dim Temp As String Dim i As Long Temp = Trim(txtInput.Text) If txtInput.Text <> "" Then txtCommon.Text = "" ReDim Preserve CodeString(iCoint) CodeString(iCoint) = Temp If UBound(CodeString) = 0 Then txtCommon.Text = CodeString(0) Else For i = iCoint To 0 Step -1 txtCommon.Text = txtCommon.Text & CodeString(i) & vbCrLf Next i End If iCoint = iCoint + 1 End If Temp = "": txtInput.Text = "" End Sub Private Sub Form_Initialize() iCoint = 0 ReDim CodeString(iCoint) End Sub Private Sub Form_Load() txtInput.Text = "": txtInput.TabIndex = 0 cmdGo.TabIndex = 1 txtCommon.Text = "" End Sub