Substring and superstrings


T

T.K Kullervo

Is there anyway to get substring or superstring characters in a label? I
need to have chemical equations in labels, like H2O + Na2S
 
Ad

Advertisements

J

Jeremy Cowles

Is there anyway to get substring or superstring characters in a label? I
need to have chemical equations in labels, like H2O + Na2S
Yes & no: there are some characters that are sub/sup because they are part
of the char set eg:¹²°³, but other than that, you must manually draw them,
which you could do relatively easily with a picture box. The down side of
drawing the strings manually is that you will also have to implement
everything else manually as well... You do, of course, have the option of
just not using word wrap, or the other bells & whistles.

HTH

~
Jeremy
 
J

Jay B. Harlow [MVP - Outlook]

T.K Kullervo,
In addition to drawing the string yourself in a PictureBox,

Consider using a RichTextBox and format the string with super scripts & sub
scripts.

Looking at the properties & methods of the RichTextBox, you may need to set
the RTF property to get the super scripts & sub scripts into the string.

I was able to cut & paste a string with super scripts & sub scripts from MS
word into a RichTextBox and it displayed correctly, so it is possible...

Hope this helps
Jay
 
D

Dave Martin

T.K Kullervo said:
Is there anyway to get substring or superstring characters in a label? I
need to have chemical equations in labels, like H2O Na2S
Wouldn't it be great if someone wrote some sort of label control which
supported HTML's <SUB> and <SUP> tags so that you could easily put subscript
and superscript text on a form ?

Unfortunately, I can't tell you that I have already done this or where you
might be able to find it, or who I work for, because that would probably be
considered advertising and this message would be deleted.

Sorry I can't be of more help.

Dave.
 
D

Dave Martin

Jay B. Harlow said:
Dave,
Actually! ;-)

You could use IE as an activeX control and embed that on a form.

Good idea.
Jay
Jay,

Seems like overkill for what T.K. wants to do, don't you think ?

Dave.

PS: Not quite sure what you mean by "Actually! ;-)".
 
C

Cor

Hi,
Don't you think most answers are to complicated when you look to the
question
I did think just copy a nice string in your program and say
label.text="string"
But that seems to easy I think
It looks if it is not VB but VC (Visual Complicated)
Cor
 
Ad

Advertisements

J

Jay B. Harlow [MVP - Outlook]

Dave,
PS: Not quite sure what you mean by "Actually! ;-)".
You suggested that it would be great is someone wrote a HTML control, I was
pointing out that someone already has!

Because as you say, and I agree, its overkill, I included a smiley face.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top