Get List of Words in a TextBox

Hi! I'm back! :) For now, we will make a program that can get a list of words in a textbox or I mean retrieving each word one by one. strong>Now, let's start this tutorial! 1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application. 2. Next, add one textbox named TextBox1, button named Button1, and a lisview named ListView1. You must design your layout like this: design 3. Now put add this code for your code module. This code is for Button1_Click. This will trigger to get the words one by one in your inputted text in the TextBox1.
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. Dim texts() As String
  3. Dim spacing() As Char = {" "c}
  4. texts = TextBox1.Text.Split(spacing)
  5. Dim word As String
  6. For Each word In texts
  7. ListBox1.Items.Add(word)
  8. Next
  9. End Sub

Explanation:

We have initialized variable texts as a String,variable spacing as character that will hold the spacing and variable word as string. Next, we put a value to our variable texts to split the words in Textbox1 and then create a spacing in that. We have also created a For Each loop to find the words in the variable texts that holds the split words in the inputted texts of Textbox1. Then the word variable which holds now the split words of Textbox1 will be displayed in our ListView1.

Output:

output For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below. Best Regards,

Engr. Lyndon R. Bermoy
IT Instructor/System Developer/Android Developer
Mobile: 09079373999
Telephone: 826-9296
E-mail:[email protected]

Visit and like my page on Facebook at: Bermz ISware Solutions

Subscribe at my YouTube Channel at: SerBermz

Add new comment