|
-
Dec 9th, 2002, 10:07 PM
#1
Thread Starter
Junior Member
a quick one for yaa
how do get an item in cobBox1 appear automatically when u search
for an item . so if an item is found then show the item in cobBox1 else show MsgBox.
Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
Dim itemSearch As Integer
Dim itemFound As Boolean
For itemSearch = 0 To (cobProduct.Items.Count - 1)
If (txtSearch.Text) = CStr(cobProduct.Items.Item(itemSearch)) Then
itemFound = True
cobProduct.Items.Item(itemSearch) ' error / this line to be checked
MsgBox(" herryaa") ' a test to indicate item found = true
End If
Next itemSearch
If itemFound = False Then
MsgBox(" product not found", MsgBoxStyle.Exclamation)
txtSearch.Text = ""
End If
End Sub
thank u
-
Dec 9th, 2002, 10:26 PM
#2
Frenzied Member
how do get an item in cobBox1 appear automatically when u search for an item . so if an item is found then show the item in cobBox1 else show MsgBox.
You were not too clear, but let me see if I understand. You want to search a textbox for a string. If the string is not in the combobox you want to add it? Its this correct??
Dont gain the world and lose your soul
-
Dec 10th, 2002, 09:03 AM
#3
Thread Starter
Junior Member
i want the item to be appeared in cobBox
there 's something wrong with the next line.. i want to search, if found select the searched item then display it (no adding it, since it's already there in a file attached to cobBox), if found = false then display error message
cobProduct.Items.Item(itemSearch)
-
Dec 10th, 2002, 09:31 AM
#4
Thread Starter
Junior Member
this should clear it
what my idea is, search through items in cobBox since they are already loaded there from a file.txt, and if found select it and display (like selecting it by clicking the arrow, scrolling down the list) in the same cobBox
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|