Solved

Assigning pictures to letters

Posted on 2003-10-30
1
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

733 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