Resetting a Form : Frame Form « GUI « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » GUI » Frame FormScreenshots 
Resetting a Form
  

Imports System.Windows.Forms

Module MainModule
    Public Sub ResetForm(ByVal FormToReset As Form)
        Dim objControl As Control
        For Each objControl In FormToReset.Controls
            If TypeOf (objControlIs System.Windows.Forms.TextBox Then
                objControl.Text = "" ' Clear TextBox
            ElseIf TypeOf (objControlIs System.Windows.Forms.CheckBox Then
                Dim objCheckBox As System.Windows.Forms.CheckBox = objControl
                objCheckBox.Checked = False ' Uncheck CheckBox
            ElseIf TypeOf (objControlIs System.Windows.Forms.ComboBox Then
                Dim objComboBox As System.Windows.Forms.ComboBox = objControl
                objComboBox.SelectedIndex = -' Deselect any ComboBox entry
            End If
        Next
    End Sub

End Module

   
    
  
Related examples in the same category
1.Simple window frameSimple window frame
2.Form Opacity in VBForm Opacity in VB
3.Non rectangle window in VBNon rectangle window in VB
4.Get Frame Client Rectangle SizeGet Frame Client Rectangle Size
5.Snap to Control
w_w_w___.__ja_va_2___s.c__o_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.