473,657 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Visual basic :How to do the code for Search button

1 New Member
Guys i got this error i don know how to slove it anyone can enlighten me?



Expand|Select|Wrap|Line Numbers
  1.  Private Sub search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles search.Click
  2.         Dim NameSearch As String = txtInput.Text
  3.         Dim FoundIt As Boolean = False
  4.         For MaxNum As Integer = 0 To ListBox.Items.Count - 1
  5.  
  6.             If ListBox.Items(MaxNum).ToString.ToUpper.ToCompare(NameSearch.ToUpper) = 0 Then
  7.  
  8.             Else
  9.  
  10.  
  11.                 If ListBox.Items(MaxNum).ToString.Contains(NameSearch) Then
  12.  
  13.                     MessageBox.Show("Found It", "Name Search", MessageBoxButtons.OK, MessageBoxIcon.Information)
  14.                     FoundIt = True
  15.                     Exit For
  16.                 End If
  17.             End If
  18.         Next
  19.  
  20.         If Not FoundIt Then
  21.             MessageBox.Show("Not Found", "Name Search", MessageBoxButtons.OK, MessageBoxIcon.Information)
  22.         End If
  23.     End Sub
  24.  
  25. End Class
Jul 31 '07 #1
0 1406

Sign in to post your reply or Sign up for a free account.

Similar topics

10
4366
by: John | last post by:
I have a problem, it's not with any code I have because... there is no code. When I run a blank visual basic 6 form, it opens up just fine. When I add a text box, a caption, and a button... it gives me an error from microsoft's error report and asks me to send or not send the error, i chose and then it quits. The error report won't let me copy the data, but i gather it's pretty useless information unless you have the source code to visual...
5
1827
by: Raymond 03077 | last post by:
I would like to know how to get started to do the following: I would like to develop a program that acts almost like a macro in the sense when I push a button in VB it retrieves data from my text file and inputs it into a text box on a specific web page and then activates a button on that web page to search the web site's data base. If it gets a positive hit then it activate the file menu on the web page's menu bar to save the data on my...
4
5167
by: Andy | last post by:
In visual studio, I have an asp.net project. When I debug, I have to manually attach to aspnet_wp.exe. My project used to automatically attach to this process. How do I get it to automatically attach to it again.
10
14360
by: Robert Jacobson | last post by:
Hi, I'm develing a COM add-in for Microsoft Word XP that displays a form. I'd like to have the form display using the Windows XP theme. However, neither using a manifest nor calling Application.EnableVisualStyles does the trick. (EnableVisualStyles works but massive instability, probably because the system is trying to theme the Word application itself.) I'm now trying to selectively enable the themes for just my form, or just...
0
1511
by: Dr. Zharkov | last post by:
Hello. To see the graphics of technology DirectX 9.0 SDK Update - June 2005 in project Visual Basic, WindowsApplication1 from Visual Studio 2005 Beta 1, in file My Project, MyApplication.vb in a method: <Global.System.Diagnostics.DebuggerStepThrough()> _ Protected Overrides Sub OnCreateMainForm()
10
8195
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied everything I can find on COM Interop and .NET. I've also tried many of the 'Walkthroughs' on the MSDN site relating to COM add-ins, .NET and Office XP but am unable to get even these working in Excel 2002 or Word 2002. I've installed the Office XP...
4
1723
by: MikeB | last post by:
I've been all over the net with this question, I hope I've finally found a group where I can ask about Visual Basic 2005. I'm at uni and we're working with Visual Basic 2005. I have some books, - Programming Visual Basic by Balena (MS Press) and - Visual Basic 2005 by Willis (WROX), but they don't go into the forms design aspects and describing the various controls at all. What bookscan I get that will cover that?
0
1692
by: Faez | last post by:
i am using Visual Studio 2005 with Visual Basic language. i have a command button, labelled 'SEARCH' and i want to add the following code to the button; so that when people click on the search button (at run time), they could see the result from the search engines. the code is in HTML and i don't know how to translate or convert into VB code. ...
2
1567
by: chaosdl | last post by:
Hello, I am currently using Visual Basic 2005 express edition with a MS Access database. I have made a "Contacts" Form, where the user will be able to enter a members surname and press an OK button, this then searches through the database and displays the results in the corresponding text boxes (ID, FirstName, LastName etc) of the searched member. I have used an SQL statement to search through the database, the problem I am having is filling...
0
8421
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8742
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.