vb.net code for searching

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 6
Reputation: pcr is an unknown quantity at this point 
Solved Threads: 0
pcr pcr is offline Offline
Newbie Poster

vb.net code for searching

 
0
  #1
May 12th, 2008
Can anyone please send code for search form which contains clearing controls,validating and contains same criteria when you click search again button.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: vb.net code for searching

 
0
  #2
May 13th, 2008
show us your effort friend....
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 2
Reputation: tratak is an unknown quantity at this point 
Solved Threads: 0
tratak tratak is offline Offline
Newbie Poster

Re: vb.net code for searching

 
0
  #3
May 13th, 2008
  1. Dim txtb() As TextBox = {txtA, txtB, txtC}
  2. For Each ctrl As TextBox In txtb
  3. ctrl.Text = ""
  4. Next

or

  1. For Each ctrl As Object In Me.Controls
  2. If ctrl.GetType.Name = "TextBox" Then
  3. ' do something
  4. End If
  5. Next
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 6
Reputation: pcr is an unknown quantity at this point 
Solved Threads: 0
pcr pcr is offline Offline
Newbie Poster

Re: vb.net code for searching

 
0
  #4
May 13th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: vb.net code for searching

 
0
  #5
May 13th, 2008
Originally Posted by pcr View Post
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 10:14 pm.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 6
Reputation: pcr is an unknown quantity at this point 
Solved Threads: 0
pcr pcr is offline Offline
Newbie Poster

Re: vb.net code for searching

 
0
  #6
May 13th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: vb.net code for searching

 
0
  #7
May 14th, 2008
this following code to clear controls, you can add what control you want to clear :
  1. Public Sub ClearControl(ByVal root As Control)
  2. For Each ctrl As Control In root.Controls
  3. ClearControl(ctrl)
  4. If TypeOf ctrl Is TextBox Then
  5. CType(ctrl, TextBox).Text = String.Empty
  6. ElseIf TypeOf ctrl Is ComboBox Then
  7. CType(ctrl, ComboBox).Text = String.Empty
  8. End If
  9. Next ctrl
  10. End Sub
  11.  
  12. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  13. ClearControl(Me)
  14. End Sub
Last edited by Jx_Man; May 14th, 2008 at 1:22 am.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC