This program uses string array, Keypress event’s KeyChar, SubString(), Remove() and Insert().
Also, it illustrates the use of #region & #endregion to organize your codes.
Add a new project with the following controls:
- Two textboxes (ReadOnly=true)
- Two labels with text as shown below
- Form1 (KeyPreview = true)
Add codes:
(Click on the images to view in full)
(1) Declare variables and create the required stuff in Form1_Load method:
(2) Add Form1_KeyPress event handler:
(2A) Add in the codes for “Check the character being pressed”
(2B) Post check processing
Try it!
0 comments:
Post a Comment