473,672 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I add trailing spaces within a right-justified textBox?

How do I add trailing spaces within a right-justified textBox?

In order to add a trailing space to the text in a right-justified textBox,
I use to just append a space to the end of the text string.
But now, textBox seems to have gotten smarter,
as it automatically remove trailing spaces.

So the question remains:

How now do I add trailing spaces to text inside a right-justified textBox?

Thanks all,

- Stan Shankman
Nov 15 '05 #1
5 3358
Hi Stan,

What do you mean by right justified?
I am afraid I could not reproduce your problem.
I tried using a textbox with TextAlign.Right or RightToLeft.Yes , but both
seem to accept trailing spaces both to the front and behind.

--
The hotmail account will most likely not be read, so please respond only
to the news group.
Nov 15 '05 #2
Well, it doesn't work for me. Something has changed on me.
Maybe it's the way I actually try to add a space.

I do this:
textBox1.Text = "test" + " " ;

Do you see anything wrong with this?

- Stan Shankman

"Morten Wennevik" <Mo************ @hotmail.com> wrote in message news:op******** ******@msnews.m icrosoft.com...
Hi Stan,

What do you mean by right justified?
I am afraid I could not reproduce your problem.
I tried using a textbox with TextAlign.Right or RightToLeft.Yes , but both
seem to accept trailing spaces both to the front and behind.

--
The hotmail account will most likely not be read, so please respond only
to the news group.

Nov 15 '05 #3
Sorry, for me that still adds the extra " " as expected.

textBox1.Text = "test" + " "; is the same as
textBox1.Text = "test ";
Other than it takes a splitsecond (nothing you could really meassure)
longer to assign since it has to be added up first.

--
The hotmail account will most likely not be read, so please respond only
to the news group.
Nov 15 '05 #4
Okay, I guess I had some confusion over the two textBox properties:

RightToLeft, and TextAlign

Once I get them both set correctly, things started working as before.
I am resurrecting some old code, and since I don't recall making any changes,
I was surprised to see discover that it wasn't working as it had been.

Is the RightToLeft property new to VS 2003?

Hey, and thanks for the serious effort you put in with your assistance.

Much appreciated,

- Stan Shankman

"Morten Wennevik" <Mo************ @hotmail.com> wrote in message news:op******** ******@msnews.m icrosoft.com...
Sorry, for me that still adds the extra " " as expected.

textBox1.Text = "test" + " "; is the same as
textBox1.Text = "test ";
Other than it takes a splitsecond (nothing you could really meassure)
longer to assign since it has to be added up first.

--
The hotmail account will most likely not be read, so please respond only
to the news group.

Nov 15 '05 #5
The RightToLeft property is for "reverse" writing style, like arabic,
where you write from right to left. Each new character is put to the
right of the last one (instead of the usual left).

I don't remember ever testing it in VS2002 but since .NET has focused on
global/localization I would be surprised if it wasn't there.

Glad to be of assistance :)

--
The hotmail account will most likely not be read, so please respond only
to the news group.
Nov 15 '05 #6

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

Similar topics

4
22843
by: Jay Chan | last post by:
I am trying to export data from a SQLServer database into a text file using a stored procedure. I want to be able to read it and debug it easily; therefore, I want all the columns to indent nicely. This means I need to append trailing spaces to a text string (such as "Test1 ") or append leading space in front of a text string that contains a number (such as " 12.00"). Now, the stored procedure works fine when I run it in Query Analyzer....
7
7416
by: ITM | last post by:
Can anyone tell me how I can prevent Access adding trailing spaces when I insert a value into a Text column? For example, if I execute the following statement: UPDATE Log SET Log.Title = 'Testing' WHERE Log.Identifier=1; ....then the following statement:
5
5427
by: Tammy | last post by:
I am doing some genealogy research and I have discovered that there is a lot of data available on the web in text format. The problem is that the columns in the files are lined up by spaces. I'd like to be able to import these files into Access or Excel so that they can be sorted. What I plan on doing is adding in commas at the end of each field to create a csv file. What I need to know is how can I easily remove the spaces between...
3
4537
by: Mark Urish | last post by:
I want to center-align the text in 2 Label controls, and I want the 1st char of their text to line up ------------------------------------------------------------------------------ label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter label1.Text = "IDLE"; //4 char strin label2.Text = "RUN ";//4 char string, //but trailing space ignored and it is centered as thoug...
0
1934
by: Seth | last post by:
First off, my apologies if this is in the wrong newsgroup, but I hope I'm close enough. I'm trying to do some parsing of a CSV file using OleDbConnection, but for some reason, when I populate my DataSet, it is trimming the trailing spaces. Anybody know why? Here is my code: System.Data.OleDb.OleDbConnection connection = null;
4
3754
by: Andrei Pociu | last post by:
I use a Repeater which displays values from a DataReader (which gets them from a SQL DB). Everytime I'm using: <%#DataBinder.Eval(Container.DataItem, "ColumnName")%> ....in the HTML code to output the values I get a trailing space after the result, for example if I use the following: Bla bla bla <%#DataBinder.Eval(Container.DataItem, "ColumnName")%>!
2
3311
by: rsine | last post by:
I am developing a program that requires me to read a string of data from a text field in a database. Data is parsed from the string based upon a starting position/length. If a piece of data doesn't meet the required field length, then spaces are added, thus my issue. It appears VB.net is trimming any trailing spaces. What should be a 250 character data string is only 243 (less 7 trailing spaces). Is there a way to get this to stop? I...
4
4372
by: Albert | last post by:
This isn't entirely related to C, but Kernighan and Ritchie asks in Execise 1-18 of their C programming language book to 'Write a program to remove trailing blanks and tabs from each line of input, and to delete entirely blank lines'. What do they mean by trailing?
17
11858
by: tommy | last post by:
Hi all, I' m adding strings to some fields in my table via Access. The strings sometimes have trailing spaces and I really need to have it that way, but Access truncates trailing spaces. How can I force Access not to truncate?! Thanx, /Toommy
5
2956
by: brian.j.parker | last post by:
Hey all, I've noticed an obscure little quirk: it appears that if you use a login with trailing spaces on the name, SYSTEM_USER automatically trims those trailing spaces in SQL Server 2000, but not SQL Server 2005. Anybody know if this change in behavior is documented? If it is intentional? Is there a "quick fix" to revert to the old behavior (to automatically RTRIM the results of SYSTEM_USER in 2005) until code can be changed?
0
8504
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
8419
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
8945
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
8847
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...
1
8643
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8697
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...
1
6255
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5720
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();...
2
1839
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.