Click here to Skip to main content
15,908,776 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralReading RSA key from File Pin
Heath Stewart15-Apr-03 4:53
protectorHeath Stewart15-Apr-03 4:53 
QuestionCan I design a webserivce with c#,now I want use it with c++ and webservice have session state Pin
wxdwxd13-Apr-03 16:55
wxdwxd13-Apr-03 16:55 
GeneralCan't 'design' UserControl Pin
moredip13-Apr-03 4:01
moredip13-Apr-03 4:01 
GeneralRe: Can't 'design' UserControl Pin
Roger Alsing22-Apr-03 23:21
Roger Alsing22-Apr-03 23:21 
GeneralRe: Can't 'design' UserControl Pin
moredip23-Apr-03 0:24
moredip23-Apr-03 0:24 
Generalinitial validation of controls Pin
moredip12-Apr-03 14:17
moredip12-Apr-03 14:17 
GeneralRe: initial validation of controls Pin
Sumeet Rattan17-Apr-03 2:33
Sumeet Rattan17-Apr-03 2:33 
GeneralNumberBox - a simple digits only textbox Pin
moredip12-Apr-03 8:43
moredip12-Apr-03 8:43 
Hi all,

can anyone see anything glaringly wrong with this:
public class NumberBox : TextBox
{
	protected override void OnKeyPress( KeyPressEventArgs e )
	{
		if( !char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar) )
			 e.Handled = true;
		base.OnKeyPress( e );
	}
}


It doesn't have to be super-secure or anything (I don't care about Ctrl-V etc) cause I validate the control's Text later anyway, it's just a quick and easy way to persuade my lovely users to only enter numbers.

So I was just wondering if anyone can spot any usability problems with this? I'm not worried about
  • negative numbers
  • pasting in incorrect data, etc
  • decimal points and thousand seperators
  • TIA,

    Pete
    GeneralRe: NumberBox - a simple digits only textbox Pin
    J. Dunlap12-Apr-03 9:34
    J. Dunlap12-Apr-03 9:34 
    GeneralRe: NumberBox - a simple digits only textbox Pin
    moredip12-Apr-03 12:02
    moredip12-Apr-03 12:02 
    GeneralRe: NumberBox - a simple digits only textbox Pin
    ian mariano13-Apr-03 12:07
    ian mariano13-Apr-03 12:07 
    GeneralRe: NumberBox - a simple digits only textbox Pin
    moredip13-Apr-03 12:11
    moredip13-Apr-03 12:11 
    GeneralRe: NumberBox - a simple digits only textbox Pin
    ian mariano13-Apr-03 12:48
    ian mariano13-Apr-03 12:48 
    GeneralRe: NumberBox - a simple digits only textbox Pin
    moredip13-Apr-03 12:57
    moredip13-Apr-03 12:57 
    GeneralDebugging remoted class hosted by IIS Pin
    David Thom11-Apr-03 8:09
    David Thom11-Apr-03 8:09 
    GeneralWeb Service Problems Pin
    rantinori10-Apr-03 10:57
    rantinori10-Apr-03 10:57 
    GeneralTRYING to install .NET 1.1.... Pin
    J. Dunlap10-Apr-03 10:18
    J. Dunlap10-Apr-03 10:18 
    GeneralRe: TRYING to install .NET 1.1.... Pin
    J. Dunlap10-Apr-03 10:41
    J. Dunlap10-Apr-03 10:41 
    GeneralRe: HELP!!! TRYING to install .NET 1.1.... Pin
    J. Dunlap10-Apr-03 16:47
    J. Dunlap10-Apr-03 16:47 
    GeneralRe: HELP!!! TRYING to install .NET 1.1.... Pin
    Richard Deeming11-Apr-03 0:59
    mveRichard Deeming11-Apr-03 0:59 
    GeneralRe: HELP!!! TRYING to install .NET 1.1.... Pin
    J. Dunlap11-Apr-03 8:02
    J. Dunlap11-Apr-03 8:02 
    GeneralSame Browser and Form graphic intergace Pin
    yro10-Apr-03 6:04
    yro10-Apr-03 6:04 
    GeneralRe: Same Browser and Form graphic intergace Pin
    Stephane Rodriguez.10-Apr-03 6:33
    Stephane Rodriguez.10-Apr-03 6:33 
    GeneralInstalling Primary Interop Assemblies Pin
    Mike Dimmick10-Apr-03 3:31
    Mike Dimmick10-Apr-03 3:31 
    GeneralRe: Installing Primary Interop Assemblies Pin
    Stephane Rodriguez.10-Apr-03 6:37
    Stephane Rodriguez.10-Apr-03 6:37 

    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.