B
Brian McVay
Hi all,
I will state my problem first:
Using the VS 2003 VB.NET Smart Device project and my own extension of the
base MS textbox device control, How can I cancel an operation and prevent
unwanted character from being entered into a textbox? Or how can I undo
the operation before the textbox shows the characters entered?
Then my explanation of the situation:
I am currently developing an application targeted for the .NET CF for
Windows Mobile and have requirements surrounding text entry into textboxes.
The simple version is that I have to restrict the text entry from textbox to
textbox of acceptable characters including the following criteria: Numeric
Only, Numeric and Letters only, and also to restrict special characters to
only a few special characters for numerous differing criteria.
I have reviewed a couple of third party masked edit boxes, but due to
several reasons they are not going to be acceptable for my implementation.
I have extended the base textbox class to create my own control that
contains validation methods in the OnKeyPress and OnTextChanged methods.
Currently I have a workaround that stores a snapshot of the current state of
the textbox prior to the change and if the entry is invalid, i simpy restore
the textbox to the previous text and textselection settings, but this causes
a lot of overhead as the procedures get kicked off again just to restore the
previous text and is unsightly as the text gets entered and then stripped
out.
I wish to be able to cancel (coming from VB6 background) the keypress method
so that the operations are simply exited or somehow to undo the operation
before the unsightly entry and stripping out occurs. Undo() is not supported
for the compact framework for the existing control.
I have looked into some third party controls, such as the openNetCF
TextBoxEx, but have not found the functionality that im looking for or do
not realize how to implement the solution with those controls and would like
to keep the project to the base controls that shiped with VS2003 and just
one or two custom controls to control program bloat, overhead, resource
sizes, and minimize the toolset needed for this application for continued
maintenance and support operations if at all possible.
Any and all assistance will be greatly appreciated.
Thanks in advance!
Brian
I will state my problem first:
Using the VS 2003 VB.NET Smart Device project and my own extension of the
base MS textbox device control, How can I cancel an operation and prevent
unwanted character from being entered into a textbox? Or how can I undo
the operation before the textbox shows the characters entered?
Then my explanation of the situation:
I am currently developing an application targeted for the .NET CF for
Windows Mobile and have requirements surrounding text entry into textboxes.
The simple version is that I have to restrict the text entry from textbox to
textbox of acceptable characters including the following criteria: Numeric
Only, Numeric and Letters only, and also to restrict special characters to
only a few special characters for numerous differing criteria.
I have reviewed a couple of third party masked edit boxes, but due to
several reasons they are not going to be acceptable for my implementation.
I have extended the base textbox class to create my own control that
contains validation methods in the OnKeyPress and OnTextChanged methods.
Currently I have a workaround that stores a snapshot of the current state of
the textbox prior to the change and if the entry is invalid, i simpy restore
the textbox to the previous text and textselection settings, but this causes
a lot of overhead as the procedures get kicked off again just to restore the
previous text and is unsightly as the text gets entered and then stripped
out.
I wish to be able to cancel (coming from VB6 background) the keypress method
so that the operations are simply exited or somehow to undo the operation
before the unsightly entry and stripping out occurs. Undo() is not supported
for the compact framework for the existing control.
I have looked into some third party controls, such as the openNetCF
TextBoxEx, but have not found the functionality that im looking for or do
not realize how to implement the solution with those controls and would like
to keep the project to the base controls that shiped with VS2003 and just
one or two custom controls to control program bloat, overhead, resource
sizes, and minimize the toolset needed for this application for continued
maintenance and support operations if at all possible.
Any and all assistance will be greatly appreciated.
Thanks in advance!
Brian