473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Substring and superstrings

Is there anyway to get substring or superstring characters in a label? I
need to have chemical equations in labels, like H2O + Na2S
Nov 20 '05 #1
6 2504
> 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

Nov 20 '05 #2
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

"T.K Kullervo" <ta******@hotmail.com> wrote in message
news:Oh****************@TK2MSFTNGP11.phx.gbl...
Is there anyway to get substring or superstring characters in a label? I
need to have chemical equations in labels, like H2O + Na2S

Nov 20 '05 #3

"T.K Kullervo" <ta******@hotmail.com> wrote in message
news:Oh**************@TK2MSFTNGP11.phx.gbl...
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.
Nov 20 '05 #4

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:e$**************@TK2MSFTNGP10.phx.gbl...
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! ;-)".
Nov 20 '05 #5
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
Nov 20 '05 #6
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

"Dave Martin" <no****@nowhere.com> wrote in message
news:bi*******************@news.demon.co.uk...
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message news:e$**************@TK2MSFTNGP10.phx.gbl...
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! ;-)".

Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Don Freeman | last post by:
Seems like whatever value I use for the first int field (starting position) the substring procedure negates it and triggers a String index out of range error. I've tried all sorts of work...
7
by: Radhika Sambamurti | last post by:
Hi, I've written a substring function. The prototype is: int substr(char s1, char s2) Returns 1 if s2 is a substring of s1, else it returns 0. I have written this program, but Im sure there is an...
11
by: Darren Anderson | last post by:
I have a function that I've tried using in an if then statement and I've found that no matter how much reworking I do with the code, the expected result is incorrect. the code: If Not...
5
by: btober | last post by:
I can't seem to get right the regular expression for parsing data like these four sample rows (names and addresses changed to ficticious values) from a text-type column: Yolanda Harris, 38, of...
2
by: mallard134 | last post by:
Could someone please help a newbee vb programmer with a question that is driving me crazy. I am trying to understand a line of code that is supposed to return the domain portion of a valid email...
4
by: Jean-François Michaud | last post by:
Hello, I've been looking at this for a bit now and I don't see what's wrong with the code. Can anybody see a problem with this? Here is an XSLT snippet I use. <xsl:template match="graphic">...
6
by: kellygreer1 | last post by:
What is a good one line method for doing a "length safe" String.Substring? The VB classes offer up the old Left function so that string s = Microsoft.VisualBasic.Left("kelly",200) // s will =...
11
by: dyc | last post by:
how do i make use of substring method in order to extract the specified data from a a long string? I also need to do some checking b4 extracting the data, for instance: it only will extract the...
3
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
Two part question: 1. Is Regex more efficient than manually comparing values using Substring? 2. I've never created a Regex expression. How would I use regex to do the equivalent of what I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.