.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Masked text box text alignment

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :Windows Application

Hi All,


I have an issue which smells like a culture issue, but I can't find any difference in the language/region settings.


I have a windows forms application using masked edit text boxes to display comma separated numbers. The boxes' RightToLeft property is set to 'Yes' and the TextAlign property is set to 'Left'. This is so that the mask is aligned to the right, and when focus moves to that edit box the cursor is at the far right and the number expands to the left as you type.


When I package the app up and deploy it, the mask is still aligned to the right, but the cursor goes to the left-most position, and the number expands to the right as you type.


This looks like an environment problem to me, but I can't see anything in the language and regional settings on my test box that's different from my development machines.


Any ideas?



View Complete Post

More Related Resource Links

Masked Text box editing is difficult

I've implemented Matthew MacDonald's MaskedTextbox control, from his book, "Pro WPF in C# 2008".  It works fine, with one or 2 exceptions.  One of them is that when a user selects all of the contents in the textbox, they're used to hitting the delete key and that clearly everything out, so they can type over it.  For example, I've got a mask of "000000" for one of the boxes.  The users are used to selecting all 6 digits and then hitting the delete key and having that clear it out.  But this doesn't work that way.  Instead what they have to do is go to the end of the 6 digits and then hit the backspace kery 6 times.  That isn't anywhere near convenient as the old MaskTextBox in WinForms.  What can I do to make get this functionality back?Rod

When I click on a TextBox the text moves a little bit for Vertical Alignment

I have a Grid of text boxes defined in the XAML using the following code:         <Border Grid.Row="2" Grid.Column="11" Style="{StaticResource BorderStyleContent}" >             <TextBox Text="-15.11" Style="{StaticResource EditableTextBox}"/>         </Border> The styles are defined below:         <Style x:Key="BorderStyleContent" TargetType="Border">             <Setter Property="BorderBrush" Value="Black"/>             <Setter Property="BorderThickness" Value="1"/>             <Setter Property="Padding" Value="2"/>             <Setter Property="SnapsToDevicePixels" Value="True"/>         </Style>         <Style x:Key="EditableTextBox" TargetType="TextBox">         &nb

How to get text from Masked Text Box without the masked format while its empty


Hi there,

   Im using a maskedtextbox with mask value of "000-00-0000" . If I try to get the text value of the maskedtextbox while its empty its returning "   -  -". I would like to get empty string wen no data entered.

Please do the needful ASAP.

Thanks in Advance,

Mark As Answer or Vote As Helpful if My Reply Does.

How to make masked text box for TabletPC?.


hi Juhani,

I have a requirement like to create masked textboxes(Phone number with extension, zip,SSN)..I created them successfully..but if I ran my app on tablet PC and entering data with pen..then the mask and validation not working properly.

For ex: (___) ___-____ for this if I use pen and enter phone number i.e., 7324859000...in the masked textbox it is showing like this...   (7324859000___) ___-____.

Is there any chance to fix this. I am getting headache with this.

Please help me if you can.



Text Alignment in SQL server



Is it possible to align the resultset of SQL query in center place.

If yes means , can you plz send teh SQL code.



AutoCompleteStringCollection for text box in DataGridView 2.0

I have been searching for a way to have autocomplete in a DataGridTextBox
object. There does not appear to be an obvious way to do this like you would
for a TextBox outside of a grid using the AutoCompleteCustomSource. Any
thoughts on how I can add this collection? :)

Built-in Functions - Text and Image Functions in SQL Server

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Future versions of SQL Server will not support TEXT, NTEXT and IMAGE data types. Columns with TEXT / NTEXT data type do not support commonly used string functions such as LEN, LEFT, RIGHT, etc. Furthermore, due to the large size of TEXT data you''re likely to see performance issues if you store such data in the database. However, at times you can''t help but use the TEXT / NTEXT / IMAGE data types (for example when supporting 3rd party databases when you cannot change the schema) - this is when text and image functions come in handy.

Built-in Functions - Text and Image Functions

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Conversion of text files from ANSI to UTF-8

reading and writing text files in ANSI format and
writing html-files in Charset ISO-8859-1 (Western Europe).

Text to Voice

Text to Voice and Voice to Text convert

Voice to Text conversion:-

reference from menubuttons to text parts in article on the same page


Hi, I'm searching now for hours but couldn't find it.Cry

In my menu i have several buttons which (by a <a href..) should go the a part of an article that is in the same form.

Menu button : What is a database should go to the page default.aspx and in there is an article published.
A part of this article is having a piece of text about "what is a database"

Menu button: how to make a query should go to this same article in the same page but then to the part that is have the piece about the query. The next could be an example of what i'm doing:

    <li><a href="default.aspx ?????>what is a database</a></li>
    <li><a href="default.aspx ?????>what is a query</a></li>

Where my question marks are, there should be a connection to that particular piece of text.
In each article part there is an ID="text1" and the second part id="text2"

How shoudl i do that, Should i use a question mark.
Please give me some guidance how to structure the <li> statement or a pointer where I can read about it.


text editor


 I format lines in a .aspx file (source view) the way I can use them, and if I switch to design view or view in browser or debug, the many lines get reformatted to flow all onto one line.

I can't seem to find the correct setting to keep this from happening.

Any suggestions?


Unique text value in databse column


Hi Everyone!

I know this is probably a very basic question but how do I keep a column's text values unique in SQL server (ie for a unique username)?  The column is not an integer it's varchar(50), and it's not the primary key but I could make it the primary key if recommended.

The front end could handle it;  where the user would enter text, it's validated, then a query is done to see if that username is available.  If so, then user can decide to choose it and an insert is done, if not they pick a new username and process repeats.  With this approach, the responsibility of keeping the value unique solely rests on the front end, nothing on the database side.

Is this the correct way to handle this? 

Thank you!


Willing to Write Urdu in my text box


 hi want to write urdu in text box of my application if anyone has the solution how to do this kindly let me know

Change Button Text in Multi Language Website


Hi i developing multi language website

using Master pages

everything fine

Page_Load i set the Text property of Button Control from Resource file

like this

Button1.Text = GetLocalResourceObject("Button1")

then in the button click event i cnage the text of the Button control

Button1.Text = GetLocalResourceObject("Button1_new")

but the text doesn't change and no error messgae

what is the problem how to solve this


How to change text in columns in SSRS?


I need to create a complex report and export it to Excel. 

In the first column header, text is displayed as "Hide Daily Columns", but I need the text to change as "Unhide Daily columns" when I click on it and when the text changes the columns under "daily" header (I have 3 columns under this header) present in the report shud be hidden and only weekly columns shud be visible. Any ideas please. I am new to SSRS and tried out many ways but didn't get it.

Extreme ASP.NET: Text Template Transformation Toolkit and ASP.NET MVC


The Visual Studio T4 code generation engine lets you parse an input file and transform it into an output file. We give you a basic introduction to T4 templates and show you how ASP.NET MVC uses this technology.

Scott Allen

MSDN Magazine January 2010

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend