Link to home
Start Free TrialLog in
Avatar of GarySB
GarySB

asked on

Multi colored labels

I need to display a label about 45 characters in length.  It needs to alternate certain letters using two colors.
For example "On the first Friday..."  I need all letters to be white by default and the n and both t's to be grey.  I do not mind using multiple labels so long as the spacing somehow justifies so the spacing does not look strange.  Please provide a sample routine that can accept a string, Thank You.

I also have a routine that uses DrawString.  VB5 does not like that or the dim statements assigning a new font in the same instruction.  If you can provide a substitute for the instructions below that VB5 will accept and I can get it to work (or your own routine), I will still award you all the points, Thank You

     Dim DefaultFont As New Font("arial", 10, FontStyle.Regular)
      Dim BlueString As New SolidBrush(System.Drawing.Color.Blue)
      Dim RedString As New SolidBrush(System.Drawing.Color.Red)
      Dim gr As Graphics
      Dim OfficeIdentifier as string = "Office:"
      Dim LocationIdentifier as string

      LocationIdentifier = "Toronto"

      gr = LabelOffice.CreateGraphics
      gr.DrawString(OfficeIdentifier , rf, BlueString , 1, 1)
      gr.DrawString(LocationIdentifier , rf, RedString , 40, 1)

ASKER CERTIFIED SOLUTION
Avatar of Dana Seaman
Dana Seaman
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GarySB
GarySB

ASKER

Thank You!!! I updated to vb6 since I needed the additional functionality.  It Works!!!