C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » .NET Framework »

Clear the Forms control which either in a Group box or any container control


Posted Date: 05 Jul 2004    Resource Type: Articles    Category: .NET Framework
Author: Prashant soniMember Level: Bronze    
Rating: 1 out of 5Points: 7




Public Sub ClearFormControls(ByRef obj As Object)
Dim objCont As Object
For Each objCont In obj.Controls
If objCont.Controls.Count > 0 Then
ClearFormControls(objCont) ''Call recursively if objcont is container control
Else
'Check type of objcont to clear the control
Select Case objCont.GetType.ToString.ToUpper
Case "System.Windows.Forms.TextBox".ToUpper
objCont.Text = ""
Case "System.Windows.Forms.ComboBox".ToUpper
objCont.SelectedIndex = -1
Case "System.Windows.Forms.DateTimePicker".ToUpper

objCont.Format = DateTimePickerFormat.Custom
objCont.CustomFormat = "dd-MMM-yyyy"
objCont.value = mdtCurrentDate
If objCont.ShowCheckBox Then
objCont.Checked = False
End If
Case "System.Windows.Forms.CheckBox".ToUpper, "System.Windows.Forms.RadioButton".ToUpper
objCont.Checked = False
End Select
End If
Next
End Sub




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: A common function in VB.NET to execute any stored procedure in SQL server 2000
Previous Resource: Asynchronous socket Programming using C#
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use