Hi, i want to transfer every text that is entered into a textbox1, into another textbox, textbox2(which is multi line textbox).
But i want textbox2 to arrange every input it recieves from textbox one in alphabetical order. This is the code i have below

Imports Microsoft.VisualBasic.ControlChars
Imports System.IO
Public Class Form2
    Inherits System.Windows.Forms.Form
    Dim value1 As String
    Dim value2 As String

    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        value2 = TextBox2.Text
        TextBox2.AppendText(TextBox1.Text & NewLine)
        TextBox1.Clear()
        TextBox1.Select()
    End Sub

Thanks

Recommended Answers

All 2 Replies

The alphabetical part will suck, you have to compare each new entry to every entry already in the second textbox until you find the proper spot. Goodluck with that :D

I forgot to add you need to compare the first couple of characters, incase you have any that start with the same letter, then you need to compare the second character, and so on.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.