Public Overloads Function Empty_Fields :
Public Overloads Function Empty_Fields :
This function is used to clear the textboxes in a form.
It accepts 2 arguments namely Frm and Tabpageindex.
Frm – Name of the Form
TabPageindex – Number of the selected Tab page of Tab control.
The following loop structure rotates for each control in the form.
For frm_cntrl = 0 To Frm.Controls.Count - 1
The following statement check the current control is Tab control or not
If Frm.Controls(frm_cntrl).GetType Is GetType(TabControl) Then
The following statement loops for each tab page of selected Tabcontrol.
For tabpages = 0 To CType(Frm.Controls(frm_cntrl),TabControl).TabPages.Count-1
In the following code, line No 1 checks for the selected tabpage
Line no 2 loops for each control in the tabpage.
Line no 3 checks for textbox control and it clears the textbox
Line no 6 checks for group box (Frame Control)
Line no 9 loops for textbox control in the selected group box control
Line no 10 & 11 checks for textbox and clears it.
<< Home