Solved

Assigning pictures to letters

Posted on 2003-10-30
1
252 Views
Last Modified: 2010-05-03
Ok this is what i need, when you type your name into a textbox and click a button the code will assign a picture to each letter in the string.

i am trying a for next loop, i have the string lenght by using Len, but how do i get it to search for each character and output the coressponding picture.

Cheers
0
Comment
Question by:col_jack_oneal
1 Comment
 
LVL 18

Accepted Solution

by:
bobbit31 earned 70 total points
ID: 9653227
Dim curChar as String

Public Sub Command1_Click()
  for i = 1 to Len(Text1.Text)
     curChar = Mid(Text1.Text, i, 1)

     '' curChar will now contain the current character in the string
     if curChar = "A" Then
        PictureBox1.Picture = LoadPicture("<path to image for letter A>")
     elseif
        etc... '' you could also use a SELECT CASE clause if you don't want if then else
     end if
  next

End Sub
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question