Click here to Skip to main content
15,909,325 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to avoid repeated output statement... Pin
Martin#20-Jan-10 0:35
Martin#20-Jan-10 0:35 
Questionremote desktop Pin
v_neil8719-Jan-10 19:44
v_neil8719-Jan-10 19:44 
GeneralRe: remote desktop Pin
Calla19-Jan-10 20:29
Calla19-Jan-10 20:29 
GeneralRe: remote desktop Pin
v_neil8719-Jan-10 21:08
v_neil8719-Jan-10 21:08 
GeneralRe: remote desktop Pin
Calla19-Jan-10 21:22
Calla19-Jan-10 21:22 
GeneralRe: remote desktop Pin
v_neil8719-Jan-10 23:24
v_neil8719-Jan-10 23:24 
GeneralRe: remote desktop Pin
Calla20-Jan-10 0:42
Calla20-Jan-10 0:42 
GeneralRe: remote desktop Pin
v_neil8720-Jan-10 0:56
v_neil8720-Jan-10 0:56 
GeneralRe: remote desktop Pin
Calla20-Jan-10 1:06
Calla20-Jan-10 1:06 
GeneralRe: remote desktop Pin
v_neil8720-Jan-10 19:28
v_neil8720-Jan-10 19:28 
GeneralRe: remote desktop Pin
Calla20-Jan-10 21:14
Calla20-Jan-10 21:14 
GeneralRe: remote desktop Pin
v_neil8720-Jan-10 22:07
v_neil8720-Jan-10 22:07 
QuestionVS2010 Beta 2 does not ship Crystal reports anymore - cannot find crystaldecissions Pin
ArjenGroeneveld19-Jan-10 19:15
ArjenGroeneveld19-Jan-10 19:15 
QuestionProblem with Visio 2007 Pin
coder21k19-Jan-10 18:27
coder21k19-Jan-10 18:27 
QuestionAdjusting screen resolution Pin
bLeZy19-Jan-10 16:49
bLeZy19-Jan-10 16:49 
QuestionOnly allow for a double in textbox Pin
tonyonlinux19-Jan-10 13:12
tonyonlinux19-Jan-10 13:12 
I have looked on google and I can't find anything that does what I need in an example..

I want to validate the textbox on keypress and make it where the user(me) can't enter anything other than a price value. like 1.99 2.99 whatever..

I have it working so far as to only allow numbers a backspace and the '.' but I can't figure out how to restrict it to only 2 places after the decimal. Any help would be great. thanks..

Here is what I have so far...
private void Price_KeyPress(object sender, KeyPressEventArgs e)
        {
            
            e.Handled = !Char.IsNumber(e.KeyChar) && (e.KeyChar != '\b')&& (e.KeyChar != '.');

            
        }

AnswerRe: Only allow for a double in textbox Pin
Jimmanuel19-Jan-10 13:26
Jimmanuel19-Jan-10 13:26 
GeneralRe: Only allow for a double in textbox Pin
Luc Pattyn19-Jan-10 13:52
sitebuilderLuc Pattyn19-Jan-10 13:52 
AnswerRe: Only allow for a double in textbox Pin
Dan Mos19-Jan-10 13:49
Dan Mos19-Jan-10 13:49 
GeneralRe: Only allow for a double in textbox Pin
Luc Pattyn19-Jan-10 13:55
sitebuilderLuc Pattyn19-Jan-10 13:55 
GeneralRe: Only allow for a double in textbox Pin
Dan Mos19-Jan-10 14:08
Dan Mos19-Jan-10 14:08 
AnswerRe: Only allow for a double in textbox Pin
DaveyM6919-Jan-10 14:38
professionalDaveyM6919-Jan-10 14:38 
AnswerRe: Only allow for a double in textbox Pin
OkkiePepernoot19-Jan-10 21:04
OkkiePepernoot19-Jan-10 21:04 
AnswerRe: Only allow for a double in textbox Pin
hasarian1-Aug-11 10:00
hasarian1-Aug-11 10:00 
Questionhook createDCW function in gdi32.dll Pin
toronja7219-Jan-10 11:52
toronja7219-Jan-10 11:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.