473,790 Members | 2,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Right Justify Textbox

How do I right justify input data in a textbox? I have some textboxes that
are used to input numbers, and I would like to right justify them.
Aug 10 '05 #1
6 9450
Here's how to do it (assuming textbox is named myTextBox)

myTextBox.TextA lign = HorizontalAlign ment.Right;
Hope this helps :-)

Brian Delahunty
Ireland

http://briandela.com/blog
"Leonard" wrote:
How do I right justify input data in a textbox? I have some textboxes that
are used to input numbers, and I would like to right justify them.

Aug 10 '05 #2
Hi Brian,
I am using a textbox on a web application, and I also want to right
justify on some cells in a datagrid, while editing. The textbox doesn't
allow for TextAlign. I checked the help, and it looks like this may be for a
windows form. I thought there might be something under styles or controls,
but haven't been able to find anything.

"Brian Delahunty" wrote: Here's how to do it (assuming textbox is named myTextBox)

myTextBox.TextA lign = HorizontalAlign ment.Right;
Hope this helps :-)

Brian Delahunty
Ireland

http://briandela.com/blog
"Leonard" wrote:
How do I right justify input data in a textbox? I have some textboxes that
are used to input numbers, and I would like to right justify them.

Aug 11 '05 #3
Ahok, sorry, I assumed it was Windows Forms.

Just do this for ASP.NET:

<asp:TextBox id="TextBox1" dir=rtl runat="server"> </asp:TextBox>

I'm not sure if there is a programatic way to do this.

Hope that helps.

--
Brian Delahunty
Ireland

http://briandela.com/blog

INDA SouthEast - http://southeast.developers.ie/ - The .NET usergroup I
started in the southeast of Ireland.
"Leonard" wrote:
Hi Brian,
I am using a textbox on a web application, and I also want to right
justify on some cells in a datagrid, while editing. The textbox doesn't
allow for TextAlign. I checked the help, and it looks like this may be for a
windows form. I thought there might be something under styles or controls,
but haven't been able to find anything.

"Brian Delahunty" wrote:

Here's how to do it (assuming textbox is named myTextBox)

myTextBox.TextA lign = HorizontalAlign ment.Right;
Hope this helps :-)

Brian Delahunty
Ireland

http://briandela.com/blog
"Leonard" wrote:
How do I right justify input data in a textbox? I have some textboxes that
are used to input numbers, and I would like to right justify them.

Aug 11 '05 #4

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
Dim frm As Control = Me.FindControl( "Form1")
Dim ctl As Control
For Each ctl In frm.Controls
If TypeOf ctl Is TextBox Then
DirectCast(ctl, TextBox).Style( "TEXT-ALIGN") = "right"
End If
End Sub

u can changed left, center.
regards,

Leonard wrote:
How do I right justify input data in a textbox? I have some textboxes that
are used to input numbers, and I would like to right justify them.

Aug 14 '05 #5
asp doesn't have property alignment.
Leonard wrote:
How do I right justify input data in a textbox? I have some textboxes that
are used to input numbers, and I would like to right justify them.

Aug 14 '05 #6
Hi Supra,
Exactly what I needed.

Thanks, Leonard

"Supra" wrote:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
Dim frm As Control = Me.FindControl( "Form1")
Dim ctl As Control
For Each ctl In frm.Controls
If TypeOf ctl Is TextBox Then
DirectCast(ctl, TextBox).Style( "TEXT-ALIGN") = "right"
End If
End Sub

u can changed left, center.
regards,

Leonard wrote:
How do I right justify input data in a textbox? I have some textboxes that
are used to input numbers, and I would like to right justify them.

Aug 15 '05 #7

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

Similar topics

0
1397
by: David Holmes | last post by:
Hi Acc 97 is it possible to right justify numbers in a list box Thanks in advance Dave Holmes
2
18744
by: jwatts | last post by:
Hello group, I am feeling pretty good about this program. I am just learning and am trying to get the basics down. I would like to ask if someone could tell me how to right justify the BALANCE column in my program's output. =============== Here is my code: ===============
1
18319
by: Kevin R | last post by:
Hi All, I am using for(i = . . . . .) sw.WriteLine(string.Format("{0} {1}", num1, num2)); and I am getting 12 123
2
2131
by: Tina | last post by:
Is there any way to get the text property to right justify in controls like Hyperlink buttons and labels? Thanks, T
2
1652
by: John Wilson | last post by:
Here's a dumb question from a learner: In a datagrid in a web page, how do I right justify a column of figures? I bet its easy once you know. John Wilson
8
390
by: Leonard | last post by:
How do I right justify input data in a textbox? I have some textboxes that are used to input numbers, and I would like to right justify them.
9
20082
by: JG | last post by:
I'm new obviously to html and I'm looking for a way put an image on the right side of the page opposite text on the left. How does one do this? I've heard of text wrapping of an image but not sure if this is what I really want, and further don't know how to do that either. Appreciate any info.
5
2705
by: tshad | last post by:
I have a datagrid that I cannot get to right justify a money amount (which is just a label). No matter what I do - it still right justifies it. <asp:TemplateColumn Visible="true" itemStyle-Width="100px" HeaderText="Amount Per Job" HeaderStyle-Font-Bold="true" ItemStyle-VerticalAlign="middle" ItemStyle-HorizontalAlign="right" > <itemtemplate> <asp:Label ID="JobBoardPriceDisplay" style="text-align:right" runat="server"/> </itemtemplate>
2
4626
by: eighthman11 | last post by:
Hello everyone, I'm using Access 2000 and SQL 8.0 This maybe easy but I can't figure it out. I have a linked access table to a SQL server table. I use this table on a Grid on an Access form. There is a field on the grid for the Equipment Number the field is called Equipment (I know original). The data type for this field is varchar with a length of 10 and the data is rigth justified in the table on the SQL Server.
0
9511
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
10412
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
10200
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
10142
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
9986
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
7529
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
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.