Solved

Assigning pictures to letters

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now