| Author: Debasish Bose 15 Aug 2004 | Member Level: Bronze Points : 0 |
The WndProc that .NET provides is just an OOP wrapper around classic WindowProcedure in Win32 development. It's a very low-level or crude way to get the job done. May be your event is executing(although it's checking only WM_CHAR messages) 100 times/sec for all those stupid WM_ messages.
A better way is to override the function OnKeyPress
Improvement : Modify it for double(s) and expose property for "Integer Precesion" and "Decimal Precesion"
Take care. Bye
|
| Author: Sudip Purkaystha 16 Aug 2004 | Member Level: Bronze Points : 0 |
Debasish, U r sometime true, when u develop a control solely dedicated to your application. But when u r on development of Controls, you need to trap only this WndProc only because, its provides the main thread to handle windows message..Hope u dont like all those WM_messages. But these r the core part of windows messaging.
Anyway i ll look into your valuable suggestion.. Thanks
|
| Author: Debasish Bose 18 Aug 2004 | Member Level: Bronze Points : 0 |
I know all those WM_ messages flowing into a infinite loop that every win32 program establishes and I'm in core win32 development for 4 years. But that's not the issue. In .net developing well-architected controls living in separate assemblies are nothing didfferent than those which are 'internal' controls to a specific project. This point I couldn't understand. I have published several sophisticated .NET control libraries on .net but I've never overrided a single WndProc. Due to the VM-like runtime host all .NET programs are slower than their C++ conterpart and this simple technique will make them more slower. When you have 30 such numeric textboxes on a typical GUI screen you got a problem.
|
| Author: Prasad 21 May 2005 | Member Level: Bronze Points : 0 |
Nice Article.
Here is simple Technique...
Use JavaScript to-do same job in few lines.
string checkNums ="javascript:if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false; "; TextBoxName.Attributes.Add("onKeypress",checkNums);
put this code in Page_Event().
you are all set to go.
Thanks, Prasad
|
| Author: Prasad 21 May 2005 | Member Level: Bronze Points : 0 |
Nice Article.
Here is a simple Technique...
Use JavaScript to-do same job in few lines.
string checkNums ="javascript:if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false; "; TextBoxName.Attributes.Add("onKeypress",checkNums);
put this code in Page_Event().
you are all set to go.
Thanks, Prasad
|