Solved

Assigning pictures to letters

Posted on 2003-10-30
1
257 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

827 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