473,396 Members | 1,847 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,396 software developers and data experts.

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 3342
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.microsoft.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.microsoft.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
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....
7
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 =...
5
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...
3
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...
0
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...
4
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...
2
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...
4
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,...
17
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...
5
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...
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...
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...
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.