ES_NUMERIC for decimal numbers?

  • Thread starter Thread starter PeterB
  • Start date Start date
P

PeterB

Hi!

Using _managed_ code but PInvoking coredll.dll, I know you can use:

SetWindowLong(hwnd, GWL_STYLE, 0|ES_NUMBER)

to set a textbox as Numeric only. But this doesn't work for decimal numbers
(5,40 ; 0,23) nor does it accept negative values. Is there a way to get that
functionality or will it require a custom control which overrides
keydown/keypress events?

Thanks ni advance!

/ Peter
 
Thanks, I will have a look at that!

These things are usually done in _alot_ simpler manner on the full framework
though...

But I will have a look at the article, thanks again!

/ Peter



Stuart Celarier said:
Paul said:
You have to do the validation yourself for that.

For an example on how to do that see Developing Compelling User Controls
that Target Forms in the .NET Framework [1] from MSDN Magazine, April
2002.

Cheers,
Stuart Celarier, Fern Creek

[1] http://msdn.microsoft.com/msdnmag/issues/02/04/winforms/
 
Back
Top