Problem:
Resolution:
Example Description:
TESTAUTOTAB
This example program demonstrates one method of implementing an autotab function to move between controls when a TextBox field is filled to iots maximum length. There are 4 TextBox controls on the form and each has its maxlength property set to 3. Everytime a character is entered into one of the TextBox controls a TextChange event is triggered. Each of the TextBox controls has the method check_TextChanged set as its event handler. The eventhandler checks the current length of the TextBox control against its maximum size and if they are equal it generates a Tab key press using the SendKeys::Key method.
inherits type System.Windows.Forms.Form.
working-storage section.
method-id NEW.
procedure division.
invoke self::InitializeComponent
goback.
end method.
method-id button1_Click final private.
procedure division using by value sender as object e as type System.EventArgs.
invoke self::Close
end method. method-id check_TextChanged final private.
procedure division using by value sender as object e as type System.EventArgs.
if sender as type TextBox::MaxLength = sender as type TextBox::Text::Length
invoke type SendKeys::Send("{TAB}")
end-if
end method.
end class.
Attachments
#VisualCOBOL
#COBOL
#netexpress