[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 882
  • Last Modified:

subscript letters in VB 6.0

In VB 6.0, is there a way to write the small 2 as in CO<subscript>2 . I have a label "CO2" in my vb program, how can I change this to look like CO with small 2 to the bottom of CO.

Thank you.
0
Aiysha
Asked:
Aiysha
1 Solution
 
PaulHewsCommented:
I don't believe it's possible with a standard label.  However, it's possible through printing on the form.  Here's a little workaround:

Private Sub Form_Load()

    Label1.Font = "Arial"  'Make sure it's a true type font!!!
    PrintLabel Label1
   
End Sub

Private Sub PrintLabel(lbl As Label)
    lbl.Caption = ""
    lbl.BackStyle = vbTransparent
    Me.AutoRedraw = True
    Me.FontSize = lbl.FontSize   'You can use any font size...
    Me.Font = lbl.Font   'You can use other fonts
    Me.CurrentX = lbl.Left   'Position where you wish to start (label left, top)
    Me.CurrentY = lbl.Top
    Me.Print "CO";
    Me.CurrentY = Me.CurrentY + Me.TextHeight("CO")
    Me.FontSize = Me.FontSize / 2
    Me.CurrentY = Me.CurrentY - Me.TextHeight("2")
   
    Me.Print "2"
End Sub

0
 
JackOfPHCommented:
The only way to achieve this is to create to label and make the font size of one label smaller to the other.
0
 
Mortaza DoulatyCommented:
Using HTML or RTF text interpreting may help...
0
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!

 
JackOfPHCommented:
The only way to achieve this is to create two label and make the font size of one label smaller to the other.
0
 
Mortaza DoulatyCommented:
JackOfPH>> Not the only...
0
 
JackOfPHCommented:
I stand corrected...

thanks,

Jack
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now