473,651 Members | 2,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

StringBuilder.A ppendFormat() to underline text

when using StringBuilder to build-up a block of text (which is then assigned
to a Label control) is it possible to underline a portion of the text ?

it would seem that StringBuilder.A ppendFormat() would provide this
capability, but I can't find documentation on the proper format specifier to
underline a string ...

if this is possible, could someone please provide an example? thanks.

Nov 21 '05 #1
2 7888

"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote
when using StringBuilder to build-up a block of text (which is then assigned
to a Label control) is it possible to underline a portion of the text ?

it would seem that StringBuilder.A ppendFormat() would provide this
capability, but I can't find documentation on the proper format specifier to
underline a string ...

if this is possible, could someone please provide an example? thanks.

At first glance, the underline has always been a property of the Font,
not of the string of characters. As far as I can tell, the formating for
AppendFormat also does not include Font information, only things
like the currency symbol, decimal point, number of digits to the right
of the decimal point, and so on....

Underline is a decoration applied only when you output the data to a
display device, like a screen or monitor, it is not a part of the character
data.
LFS
Nov 21 '05 #2
hmmm .... if one is programmaticall y dynamically composing a section of text
that is meant to "flow freely" (be assigned to an auto-word-wrapping control
such as a Lable or a Span) then it's not possible to underline a sport of
that text ....

"Larry Serflaten" <se*******@usin ternet.com> wrote in message
news:u9******** ********@TK2MSF TNGP15.phx.gbl. ..

"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote
when using StringBuilder to build-up a block of text (which is then assigned to a Label control) is it possible to underline a portion of the text ?

it would seem that StringBuilder.A ppendFormat() would provide this
capability, but I can't find documentation on the proper format specifier to underline a string ...

if this is possible, could someone please provide an example? thanks.

At first glance, the underline has always been a property of the Font,
not of the string of characters. As far as I can tell, the formating for
AppendFormat also does not include Font information, only things
like the currency symbol, decimal point, number of digits to the right
of the decimal point, and so on....

Underline is a decoration applied only when you output the data to a
display device, like a screen or monitor, it is not a part of the

character data.
LFS

Nov 21 '05 #3

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

Similar topics

4
3480
by: Schley Andrew Kutz | last post by:
I am iterating through 454 rows of a table and with each row I use the ID field to form a URI for a contact in a public folder on my exchange server. My memory keeps growing though. I think it is because I reconstruct my URI each time. I have done this 2 ways and I want to know something. How is this ... StringBuilder sb = new StringBuilder( 255, 255 ); for ( int x = 0; x < rs.Rows.Count; ++x ) {
1
1784
by: ola | last post by:
How can I replace the character literals in the stringbuider below with variables? StringBuilder sData = new StringBuilder("<CABDETAILS CabNumber=\"43877\" CabSKU=\"6633\" ExpDate=\"0106\" />"); For example, I will have a variable representation of "43877" in the stringbulder. variable already declared as string xxxx = "43877" Thanks.
6
7813
by: Paulb1us | last post by:
I am writing a DataTable to a file using a stringbuilder. The Format of the date in the table is like this: '12/20/04' But after I write it to the file it ads the time: '12/20/04 12:00:00 AM' My code looks like this for(int curRow = 0; curRow < dt1.Rows.Count; curRow++) {
3
3515
by: Mariano | last post by:
Hi, Can a StringBuilder buffer be cleared? I'm confused. It is supposed that the StringBuilder class, can deal with all the memory allocation and deallocation needed for normal string operations (concatenations, replacements, etc.), because the String class just creates and destroys instances at an object level. I can't find a method to clear a StringBuilder object's buffer for reusing it (the idea is to avoid object...
0
405
by: John A Grandy | last post by:
when using StringBuilder to build-up a block of text (which is then assigned to a Label control) is it possible to underline a portion of the text ? it would seem that StringBuilder.AppendFormat() would provide this capability, but I can't find documentation on the proper format specifier to underline a string ... if this is possible, could someone please provide an example? thanks.
33
4666
by: genc_ymeri | last post by:
Hi over there, Propably this subject is discussed over and over several times. I did google it too but I was a little bit surprised what I read on internet when it comes 'when to use what'. Most of articles I read from different experts and programmers tell me that their "gut feelings" for using stringBuilder instead of string concatenation is when the number of string concatunation is more then N ( N varies between 3 to max 15 from...
0
1787
gchq
by: gchq | last post by:
Hi there I'm attempting to put together a string that will line up in columns and then insert this into a pdf form! I've managed this before, but for some reason the columns do not line up this time - been over every inch of the code and cannot fnd a reason - if anyone can spot the obvious I'd really appreciate it! Dim vInfo As New System.Text.StringBuilder() vInfo.AppendFormat("{0, -14} {1, 30} {2, 30}", "Earnings", "This...
8
3792
by: Soulless | last post by:
I am trying to implement the stringbuilder class by taking a LARGE multiline text box and looping through the lines and build a string and include \r\n in it. I get : Index was outside the bounds of the array. The code is simply: StringBuilder str = new StringBuilder();
3
11748
by: shapper | last post by:
Hello, I am creating the body of a mail message to be sent using StringBuilder: StringBuilder body = new StringBuilder(); body.AppendFormat("{0},", userName); body.AppendLine(); body.AppendLine(); body.AppendLine("How are you?");
0
8357
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8277
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8803
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8700
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8581
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.