Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Reset Controls
Author:
NBS Solutions
E-mail:
Click to e-mail author
Website:
http://www.netnet.ca
Submitted:
3/1/2004
Version:
VB5
Compatibility:
VB5, VB6
Category:
Controls
Views:
28255
Routine to reset your controls. This can be handy to use after you have updated a record and need to reset the controls for the next entry.
Declarations:
'none
Code:
Private Sub resetAll() Dim ctrlX As Control 'reset all the control values For Each ctrlX In Controls If TypeOf ctrlX Is TextBox Then ctrlX.Text = "" If TypeOf ctrlX Is CheckBox Then ctrlX.Value = 0 If TypeOf ctrlX Is OptionButton Then ctrlX.Value = False Next ctrlX End Sub 'Note 'You can asign any vb internal contol to the var and then manipulate the 'proprties as needed 'The class name of all Visual Basic internal controls. 'Remarks 'You can dimension a variable as a Control object and reference it as you would a control on a form. 'The following demonstrates this: 'Dim C as Control 'Set C = Command1
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement