Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 13-03-08, 01:05 PM
Júlio
Guest
 
Posts: n/a

Default Máscara WindowsForm

Pessoal,

Alguém possui alguma dica de Máscara (sem ser o maskedit), estou utilizando
o evento Keypress conforme abaixo, porém quando atribuo o novo valor da
string o cursor volta para a segunda posição e não última.

if (((TextBox)sender).Text.Length == 6)
{
string tmp = ((TextBox)sender).Text;
tmp += "-";

((TextBox)sender).Text = tmp;
}

e.Handled = false;

Reply With Quote
  #2 (permalink)  
Unread 27-03-10, 03:09 PM
Luis Fernando Barbosa
Guest
 
Posts: n/a

Default Re: Máscara WindowsForm

Júlio escreveu:
> Pessoal,
>
> Alguém possui alguma dica de Máscara (sem ser o maskedit), estou utilizando
> o evento Keypress conforme abaixo, porém quando atribuo o novo valor da
> string o cursor volta para a segunda posição e não última.
>
> if (((TextBox)sender).Text.Length == 6)
> {
> string tmp = ((TextBox)sender).Text;
> tmp += "-";
>
> ((TextBox)sender).Text = tmp;
> }
>
> e.Handled = false;
>

Pode usar string.Format()
Reply With Quote
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 05:46 AM.
Style Developed by Andrew Slane

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
 RSS Feeds - Archive - Top