Chemical formula with sub/superscript in TextBox, Label etc.

  • Thread starter Thread starter Christian
  • Start date Start date
C

Christian

Hi there,

At the moment I'm working on program for chemical calculations.
I created a Userform with a lot of TextBoxes and Labels for data
input.

Problem: I can't find a way to display chemical formulars (e. g. H20:
the "2" must be subscript) correctly in a textbox.caption or
label.value

Is there a way to enabel subscript or superscript for single
characters in a caption or label?

Thanx in advance for any advice,

- Christian
 
Christian,
In order to use such text formats, you need a control that supports Rich
Text Format.
The RTF box does.

Note that I now get an error "The subject is not trusted for the specified
action" when trying to use this control. AFAIK, this is the result of an
update.
A quick unregister then register of this control fixed it. If you get this
problem, maybe these will help:

http://support.microsoft.com/kb/827742
http://p2p.wrox.com/topic.asp?whichpage=1&TOPIC_ID=10894&

NickHK
 
Christian said:
Hi there,

At the moment I'm working on program for chemical calculations.
I created a Userform with a lot of TextBoxes and Labels for data
input.

Problem: I can't find a way to display chemical formulars (e. g. H20:
the "2" must be subscript) correctly in a textbox.caption or
label.value

Hi Christian,
you need the Rich Textbox (Richtx32.ocx) instead of the Text Box.The problem
is that the Rich Textbox is nolonger trusted :(

See the discussions here (Remove the carriage returns inserted in the long
URL by the news reader) :

http://groups.google.co.uk/group/mi...5369?q=richtext+peter&rnum=1#13b649c569bb5369

http://groups.google.com/group/micr...2e5230d7a81?lnk=st&q=&rnum=4#72b012e5230d7a81

Maybe you can use one of these :
Newsgroups: microsoft.public.excel.programming
From: Perico <[email protected]>
Date: Mon, 19 Jun 2006 14:03:01 -0700
Local: Mon, Jun 19 2006 11:03 pm
Subject: RE: Problem with RICHTX32.OCX

I had this problem. The solution for me was to use the msMask32.ocx
instead.

Newsgroups: microsoft.public.excel.programming
From: "RB Smissaert" <[email protected]>
Date: Fri, 5 May 2006 23:06:07 +0100
Local: Sat, May 6 2006 12:06 am
Subject: Re: Problem with RICHTX32.OCX

If you are interested I can mail you a RichTextBox control that behaves just
like the regular one but doesn't have this security problem.

RBS

hth
Gys
 
Hi Christian,
Is there a way to enabel subscript or superscript for single
characters in a caption or label?

No.

You could do this (character formatting I mean) with a textbox on a
dialogsheet way back in Excel 5. Excel still supports these dialog
sheets though.

Otherwise you'd have to use third party controls I think.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com
 
Hi Christian,

I'd propose an additional diversion: accepting the inability of
sub-/superscript input, and, for the next treatment, using the procedure,
which converts numerals correctly. If you like, I'm able to mail a well-tried
sub.

Regards
 
Back
Top