•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 374,190 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,483 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 411 | Replies: 6
![]() |
show us your effort friend....
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
•
•
Join Date: May 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Dim txtb() As TextBox = {txtA, txtB, txtC}
For Each ctrl As TextBox In txtb
ctrl.Text = ""
Nextor
For Each ctrl As Object In Me.Controls
If ctrl.GetType.Name = "TextBox" Then
' do something
End If
Next•
•
•
•
can you please send sample program with some search criteria,including clearing controls,validating and search criteria remains same when you click revise again in search form
Tratak was given u a codes, use it. however you didn't show how far u done with this? where is your effort? have u read a rules??
We only give homework help to those who show effort
Last edited by Jx_Man : May 13th, 2008 at 9:14 pm.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
•
•
Join Date: Nov 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
sub clear()
me.combobox1.clear()
me.combobox2.clear()
me.textbox1.clear()
end sub
Private Sub nameTextBox1_Validated(sender As Object, e As System.EventArgs) Handles nameTextBox1.Validated
If IsNameValid() Then
' Clear the error, if any, in the error provider.
nameErrorProvider.SetError(Me.nameTextBox1, "")
Else
' Set the error if the name is not valid.
nameErrorProvider.SetError(Me.nameTextBox1, "Name is required.")
End If
End Sub
me.combobox1.clear()
me.combobox2.clear()
me.textbox1.clear()
end sub
Private Sub nameTextBox1_Validated(sender As Object, e As System.EventArgs) Handles nameTextBox1.Validated
If IsNameValid() Then
' Clear the error, if any, in the error provider.
nameErrorProvider.SetError(Me.nameTextBox1, "")
Else
' Set the error if the name is not valid.
nameErrorProvider.SetError(Me.nameTextBox1, "Name is required.")
End If
End Sub
this following code to clear controls, you can add what control you want to clear :
vb.net Syntax (Toggle Plain Text)
Public Sub ClearControl(ByVal root As Control) For Each ctrl As Control In root.Controls ClearControl(ctrl) If TypeOf ctrl Is TextBox Then CType(ctrl, TextBox).Text = String.Empty ElseIf TypeOf ctrl Is ComboBox Then CType(ctrl, ComboBox).Text = String.Empty End If Next ctrl End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click ClearControl(Me) End Sub
Last edited by Jx_Man : May 14th, 2008 at 12:22 am.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
•
•
•
•
.net access activation api asp blogger blogging blogs code code injection combo custom dani daniweb data debugging development dreamweaver dropdownlist epilepsy gdata google gpl griefers hackers html innovation javascript key linux microsoft module net news openbsd product programming reuse rss serial skin source tags theme vista web wysiwyg xml
- Search in vb.net (VB.NET)
- ListView in VB.Net (VB.NET)
- Searching for a string in an access database (Visual Basic 4 / 5 / 6)
- Is this possible with a cookie and script (HTML and CSS)
- Hamming codes encoder/decoder in C or C++ (C++)
- Interactive excel web page and vb.net (VB.NET)
- php rewrite question (PHP)
- Menu bars and tabs in VB.NET (VB.NET)
- Creating Auto-Responder in PHP (PHP)
Other Threads in the VB.NET Forum
- Previous Thread: how to import all data stored in sql to excell?
- Next Thread: MSCOMM of VB 2005



Linear Mode