Results 1 to 4 of 4

Thread: a quick one for yaa

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    18

    Talking 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

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    18

    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)

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    18

    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
  •  



Click Here to Expand Forum to Full Width