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.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.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
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.