Link to home
Start Free TrialLog in
Avatar of mread
mread

asked on

Diagonal text on screen

Does anyone know of a control or a way to print text out on the screen on a 45 degree angle.  What I am trying to do is, I have a grid with quite a few columns and I want to put the headers on  a 45 degree angle , that way i can have more columns showing at one time.  If you send code please comment it well.  Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of vettranger
vettranger

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 jbil
jbil

A hard code solution, print directly on form using currentx,y position to place characters.

on form
label1
list1 (for list of words could be array, collection, etc.)



Option Explicit

Private Sub Form_Load()
Me.FontName = "courier" 'better for uniform spaceing
Me.FontSize = 10 'set to suit
Label1.Visible = False
Label1.Width = TextWidth("M") * 5 'can be adjusted to fit grid

With List1
.AddItem "hello"
.AddItem "there"
.AddItem "world"
.AddItem "here"
.AddItem "I am"
.Visible = False
End With

Me.AutoRedraw = True
prntDiag
End Sub

Private Sub prntDiag()
Dim numWords, numChars, thestring

For numWords = 0 To List1.ListCount - 1
thestring = List1.List(numWords)
Me.CurrentX = Label1.Left
Me.CurrentY = Label1.Top

    For numChars = 1 To Len(thestring)
     Me.Print Mid(thestring, numChars, 1);
     Me.CurrentY = Me.CurrentY + TextHeight(Mid(thestring, numChars, 1))
    Next

Label1.Left = Label1.Left + (Label1.Width / 2)

Next

End Sub


Avatar of mread

ASKER

Thanks, the web link put me in the right direction to find what i needed.
Happy to help. :-)