2010-05-12 53 views
0
Private Sub btnWord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWord.Click 
    Dim Inputter As String 
    Dim Words As String = "" 

    Do 
     Inputter = InputBox("Enter word", "Enter Word") 
     If Inputter <> String.Empty Then 
      lstDisplay.Items.Add(Inputter) 
      Word += Inputter.Substring(0, 1) 
     End If 
    Loop Until Inputter <> String.Empty 
    ' SOMETHING GOES HERE!!!!!' 
    lstDisplay.Items.Add("---") 
    lstDisplay.Items.Add(Word) 
End Sub 

下面是它的工作原理,當你點擊它會顯示一個輸入框,按鈕等等,例如輸入「CAT」。VB.NET取詞和顯示的每個字母的ListBox中

但我不知道如何讓它在列表框中執行C(換行符)A(換行符)T(換行符)。請幫忙!

Ç
一個
牛逼
-
CAT

回答

1
Private Sub btnWord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWord.Click 
    Dim Inputter As String Dim Words As String = "" 

    Inputter = InputBox("Enter word", "Enter Word") 
    Dim i as Integer 
    For i = 0 To Inputter.Length-1 
     lstDisplay.Items.Add(Inputter.Chars(i).ToString) 
    Next 

    lstDisplay.Items.Add("---") 
    lstDisplay.Items.Add(Word) 
End Sub 
+0

這做到了感謝! – Kaleet 2010-05-12 05:44:38

相關問題