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

Masked textbox alignment?

I have a masked textbox that excepts values of 0 thru 99. The mask is
00. Tabbing into this box is fine but if you click into it, you are one
space over from the left. This means you can only type one number. So
you have to hit <backspace>. How do I make it so clicking into this
box puts your cursor all the way to the left side?

Also, I can't get the box to accept the range "-1" thru "99". How can
that be done?

..NET 2.0 of course.

Thanks,
Brett

Feb 9 '06 #1
2 2543
On 9 Feb 2006 12:19:04 -0800, Brett Romero wrote:
I have a masked textbox that excepts values of 0 thru 99. The mask is
00. Tabbing into this box is fine but if you click into it, you are one
space over from the left. This means you can only type one number. So
you have to hit <backspace>. How do I make it so clicking into this
box puts your cursor all the way to the left side?

Also, I can't get the box to accept the range "-1" thru "99". How can
that be done?

.NET 2.0 of course.

Thanks,
Brett


Hi Brett,

Just a wild guess; but don't numeric fields feed from the right and fill to
the left. Maybe your width is too small for two characters? The Source code
would help.

Regards
Mark
Feb 9 '06 #2
Not sure which source code you are referring to. Drop the control onto
the form and there it is. Here's the wincode:

this.txtCount.Location = new System.Drawing.Point(519, 97);
this.txtCount.Mask = "00";
this.txtCount.Name = "txtCount";
this.txtCount.PromptChar = ' ';
this.txtCount.Size = new System.Drawing.Size(40, 20);
this.txtCount.TabIndex = 15;

Feb 9 '06 #3

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

Similar topics

7
by: |{evin | last post by:
I'm currently working on what has turned in to something much larger that I wanted it to be. The upside is that I'm getting $$ to do it... but anywho. I currently have textboxes set up to...
1
by: Kostis | last post by:
Hello there! I have created a windows application in VB.NET and I want to retrieve data from an access database. I create the OleDbConnection, an OleDbAdapter, a dataset and finally a Data Form...
7
by: DazedAndConfused | last post by:
Curently I manualy code keypress edits. i.e. allow only 3 digits before decimal and two digits after decimal in .NET. Is there an easy solution to mask text boxes? The MSMASK32.OCX from vb6...
3
by: dmbuso | last post by:
I have a money field defined in a SQL Server 05 database with a value of 49.50. Also, it displays in SQL Server as 49.5000. I have a form in VB.NET 2005 and I'm using the new MaskedTextBox control...
2
by: Subhash | last post by:
Hi, I want to apply skin themes for a masted textbox. Please help me in this issue,
2
by: gayano | last post by:
Hi, I'm using Visual studio 2005 pro Ver..]]] I have a Form named form1 textbox named txtName masked textbox (Date Masked) named txtMaskedDate and a button to add data named btnAdd dim...
3
by: gayano | last post by:
Hi, I'm using Visual studio 2005 pro Ver..]]] I have a Form named form1 textbox named txtName masked textbox (Date Masked) named txtMaskedDate and a button to add data named btnAdd dim...
0
by: michels287 | last post by:
I have a masked textbox on my form. I have an onscreen keyboard with numbers only. The masked format for the masked textbox is: (###) ### - #### I want to make sure they enter the phone...
3
by: buddyr | last post by:
Hello, I have a texbox with error provider control: if(textbox.text.length <=0) { errorprovider1.seterror(textbox,"enter part number"); } else { errorprovider1.seterror(textbox, "");
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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...

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.