473,385 Members | 2,180 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,385 software developers and data experts.

String question

Is there a way to superscript a single character in a string
for example to show a number raised to a exponent ?

Eg

lblResult.Caption = " 52 in4 "

Where the 4 would be superscripted ?

Thanks for the advice

Tom M
Jul 17 '05 #1
10 5583
> Is there a way to superscript a single character in a string
for example to show a number raised to a exponent ?

Eg

lblResult.Caption = " 52 in4 "

Where the 4 would be superscripted ?


No, not using a Label (or TextBox for that matter). You can do what you
ask using a RichTextBox though.

With RichTextBox1
.Text = " 52 in4 "
' Select the character(s) to superscript
.SelStart = 6
.SelLength = 1
' Set the amount of offset in TWIPS
.SelCharOffset = 75
End With

Rick - MVP

Jul 17 '05 #2

"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:Pb********************@comcast.com...
Is there a way to superscript a single character in a string
for example to show a number raised to a exponent ?

Eg

lblResult.Caption = " 52 in4 "

Where the 4 would be superscripted ?


I've heard of square inches and cubic inches. What, pray tell, are inches to the
4th power?

Just curious :)
Jul 17 '05 #3
> >> Is there a way to superscript a single character in a string
for example to show a number raised to a exponent ?

Eg

lblResult.Caption = " 52 in4 "

Where the 4 would be superscripted ?


I've heard of square inches and cubic inches. What, pray tell, are

inches to the 4th power?


The volume of a hyper-cube? Or maybe just a badly constructed example?

Rick

Jul 17 '05 #4
inches to the fourth power is common in the engineering field to model the
stiffness of a rigid body (Called the modulus of inertia). It is, in a
nutshell, used
to predict how much rotation a structural element will undergo when
subjected to
bending forces.

Thanks for the advice Rick. You had once helped me with another post
sometime ago
about passing an array to a function.

Question : Is the rich text box a standard control available in VB5 ? I
haven't used one
before and don't recall seeing one. And it's not in the handy little
toolbox. Could you tell
me how to use it "

----- Original Message -----
From: "Rick Rothstein" <ri************@NOSPAMcomcast.net>
Newsgroups: comp.lang.visual.basic
Sent: Thursday, April 28, 2005 11:21 PM
Subject: Re: String question

> Is there a way to superscript a single character in a string
> for example to show a number raised to a exponent ?
>
> Eg
>
> lblResult.Caption = " 52 in4 "
>
> Where the 4 would be superscripted ?


I've heard of square inches and cubic inches. What, pray tell, are

inches to the
4th power?


The volume of a hyper-cube? Or maybe just a badly constructed example?

Rick


"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:f_********************@comcast.com...
> Is there a way to superscript a single character in a string
> for example to show a number raised to a exponent ?
>
> Eg
>
> lblResult.Caption = " 52 in4 "
>
> Where the 4 would be superscripted ?


I've heard of square inches and cubic inches. What, pray tell, are

inches to the
4th power?


The volume of a hyper-cube? Or maybe just a badly constructed example?

Rick

Jul 17 '05 #5
> Question : Is the rich text box a standard control available
in VB5 ? I haven't used one before and don't recall seeing
one. And it's not in the handy little toolbox. Could you tell
me how to use it "


In VB's IDE, click on Project/Components on the menu bar. Scroll down
the list and click on the CheckBox labeled "Microsoft Rich Textbox
Control", then click OK. That will add the RichTextBox to your toolbox.
As for how to use it... well, it is full-bodied control with lots of
properties, methods and events. Your best bet is to highlight the
control after it is placed on your form and press F1 to bring up the
help file for it. Then, start reading. Also, when the help files are
displayed, click on the Search tab, type in "richtextbox" (without the
quote marks) into the search field and click the "List Topics" button.
At minimum, read the item labeled "Using the Rich TextBox Control".

Rick - MVP

Jul 17 '05 #6
As an engineer myself this problem bugs me too. The work around that I
prefer for simplicity is to use a separate label with the single character
in a reduced size for my super and sub scripts. When printing to a printer
check that you have the scaling correct else the labels may drift away from
each other.
Regards

Martin
"Tmenke" <me*****@netscape.net> wrote in message
news:3b***************************@KNOLOGY.NET...
Is there a way to superscript a single character in a string
for example to show a number raised to a exponent ?

Eg

lblResult.Caption = " 52 in4 "

Where the 4 would be superscripted ?

Thanks for the advice

Tom M

Jul 17 '05 #7

"Tmenke" <me*****@netscape.net> wrote in message
news:3b***************************@KNOLOGY.NET...
Is there a way to superscript a single character in a string
for example to show a number raised to a exponent ?

Eg

lblResult.Caption = " 52 in4 "

Where the 4 would be superscripted ?

Thanks for the advice

Tom M


Just be careful with simple beam deflection or cantilevered calculations
(see post on weird things in VB 6). Has always been there and will always
be.

We don't want our buildings and bridges be flawed cause someone uses VB math
:)
Jul 17 '05 #8

"Tmenke" <me*****@netscape.net> wrote in message
news:d8***************************@KNOLOGY.NET...
inches to the fourth power is common in the engineering field to model the
stiffness of a rigid body (Called the modulus of inertia). It is, in a
nutshell, used
to predict how much rotation a structural element will undergo when
subjected to
bending forces.


I might have guessed there would be some use for it in engineering. Thanks for
the explanation.
Jul 17 '05 #9
One more thing, do not forget to include the rich text box ocx when you
deploy your app.
It takes us a while to find that out when our app works in some clients' PC
but not others.

Egghead

"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:Xf********************@comcast.com...
Question : Is the rich text box a standard control available
in VB5 ? I haven't used one before and don't recall seeing
one. And it's not in the handy little toolbox. Could you tell
me how to use it "


In VB's IDE, click on Project/Components on the menu bar. Scroll down
the list and click on the CheckBox labeled "Microsoft Rich Textbox
Control", then click OK. That will add the RichTextBox to your toolbox.
As for how to use it... well, it is full-bodied control with lots of
properties, methods and events. Your best bet is to highlight the
control after it is placed on your form and press F1 to bring up the
help file for it. Then, start reading. Also, when the help files are
displayed, click on the Search tab, type in "richtextbox" (without the
quote marks) into the search field and click the "List Topics" button.
At minimum, read the item labeled "Using the Rich TextBox Control".

Rick - MVP

Jul 17 '05 #10
On Fri, 29 Apr 2005 11:06:15 GMT, "Raoul Watson"
<Wa*****@IntelligenCIA.com> you typed some letters in random order:
We don't want our buildings and bridges be flawed cause someone uses VB math


That makes a great signature :)

Groetjenz,

Mickey
--
#### gewoan skrieve su ast ut seist ####
Jul 17 '05 #11

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

Similar topics

2
by: sparks | last post by:
I know this is a stupid question but I can't find the answer. Please tell me where to find reference to this so I can print it out and staple it to my head.. dim I as integer dim missedstr as...
5
by: John Baro | last post by:
I have a richtextbox which I want the "literal" rtf of. richtextbox.rtf returns {\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033\\uc1 }\r\n\0 when i put this into a string I get...
5
by: Dave | last post by:
I'm receiving info from a com port into a string. I gradually process the string which constantly shortens it. The question is how long can a string be before I need to write some info to disk...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
2
by: Dan Schumm | last post by:
I'm relatively new to regular expressions and was looking for some help on a problem that I need to solve. Basically, given an HTML string, I need to highlight certain words within the text of the...
11
by: Zordiac | last post by:
How do I dynamically populate a string array? I hope there is something obvious that I'm missing here Option Strict On dim s() as string dim sTmp as string = "test" dim i as integer ...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
6
by: tommaso.gastaldi | last post by:
Hi, does anybody know a speedy analog of IsNumeric() to check for strings/chars. I would like to check if an Object can be treated as a string before using a Cstr(), clearly avoiding the time...
39
by: sucaba.r | last post by:
I don't know if this is a unique problem, or I'm going about it the wrong way. I currently connect to one of our SQL servers via a priviliged account (by using RUNAS). Works with no problem. I...
7
by: Sky | last post by:
I have been looking for a more powerful version of GetType(string) that will find the Type no matter what, and will work even if only supplied "{TypeName}", not the full "{TypeName},{AssemblyName}"...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.