Author Topic: Tab control: write vertical text  (Read 1084 times)

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Tab control: write vertical text
« on: November 21, 2016, 10:26:30 PM »
Hello, this is more of a general VB question.
I am creating a new AHMI project and I am using a standard tab control as a retractable menu docked to the right border of the main form and tab alignment set to "left". I have come to find out that changing the text color and alignment is not so simple and requires a custom 'Owner Draw Fixed" procedure.  I have the following code that does write the text vertical, however it is written "Top to Bottom".  I would like to write the text "bottom to top" as shown in the attached pic  Any one able to point me in the right direction?  Thanks

    '  Set the Alignment of the Text
     Dim sf As New StringFormat()
       sf.Alignment = StringAlignment.Center
     sf.LineAlignment = StringAlignment.Center
    sf.FormatFlags = StringFormatFlags.DirectionVertical

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Tab control: write vertical text
« Reply #1 on: November 21, 2016, 11:39:50 PM »
You can check the code of the rotating text button in this topic, to see if it might help:

https://www.advancedhmi.com/forum/index.php?topic=862.0

The rotation of the string is done inside the OnPaint sub (the angle is set inside the ButtonTextDirection property but could be set directly in the sub).
« Last Edit: May 20, 2019, 01:25:19 AM by Godra »