I'm not all for setting crap up in classes, or drawing graphs, but here would be a sample portion of the meat of the program.
'Whenever enter is pressed, run this routine
'assuming that you get your message from txtMessage.text
dim Count as integer(65 to 90)
dim Max as integer
dim MaxPointer as integer
dim Min as integer
dim MinPointer as integer
dim MaxMsg as string
dim MinMsg as string
dim Message as string
dim CurChar as string
dim Index as integer
Message = txtMessage.text
For Index = 1 to len(Message)
CurChar = ucase$(mid$(Message,Index,1)) ' grabs current character
if curChar >= "A" and CurChar <= "Z" then 'checks for valid letter
Count(asc(CurChar)) = Count(asc(CurChar)) + 1 'if valid, add to count
end if
next Index
Max = Count(65) 'Set max and min to A's count
Min = Count(65)
MaxPointer = 65
MinPointer = 65
for Index = 66 to 90
if Count(Index) > Max then
Max = Count(Index)
MaxPointer = Index
end if
if Count(Index) < Min then
Min = Count(Index)
MinPointer = Index
end if
next Index
'Now find other letters that are tied for highest or lowest
for Index = 65 to 90
if Count(Index) = Max then
MaxMsg = MaxMsg & chr$(Index) & ", "
end if
if Count(Index) = Min then
MinMsg = MinMsg & chr$(Index) & ", "
end if
next Index
'Get rid of any extra commas
MaxMsg = left$(MaxMsg,len(MaxMsg)-2)
MinMsg = left$(MinMsg,len(MinMsg)-2)
'Add appropriate label
if len(MaxMsg) > 1 then
MaxMsg = "Most Frequent letters: " & MaxMsg
else
MaxMsg = "Most Frequent letter: " & MaxMsg
end if
if len(MinMsg) > 1 then
MinMsg = "Least Frequent letters: " & MaxMsg
else
MinMsg = "Least Frequent letter: " & MaxMsg
end if
Subject to errors as I didn't actually run this, but following it should give you an idea of the algorithm.