471,603 Members | 1,506 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 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 2490
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by |{evin | last post: by
7 posts views Thread by DazedAndConfused | last post: by
2 posts views Thread by Subhash | last post: by
2 posts views Thread by gayano | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

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.