combobox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • enrico via DotNetMonster.com

    combobox

    how can i make a combobox that can store or add additional fields?

    --
    Message posted via DotNetMonster.c om
    Best online pokies for real money in Australia and learn about safety and game mechanics in this comprehensive guide.


  • Trammel

    #2
    Re: combobox

    "enrico via DotNetMonster.c om" <u41845@uwewrot e in message
    news:80ba5ee4c9 9f8@uwe...
    how can i make a combobox that can store or add additional fields?
    ComboBox1.Items .Add("blah")
    ComboBox1.Items .Add("1234")


    Comment

    • Trammel

      #3
      Re: combobox

      "Trammel" <Me@Server.comw rote in message
      news:vcIzj.2028 38$LD6.179706@f e3.news.blueyon der.co.uk...
      "enrico via DotNetMonster.c om" <u41845@uwewrot e in message
      news:80ba5ee4c9 9f8@uwe...
      >how can i make a combobox that can store or add additional fields?
      >
      ComboBox1.Items .Add("blah")
      ComboBox1.Items .Add("1234")
      This can be expanded-on using a button labeled "+" or however you submit
      changes to the form/box:

      Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
      System.EventArg s) Handles Button1.Click
      Dim iLoop As Long
      Dim bFound As Boolean = False
      For iLoop = 0 To ComboBox1.Items .Count - 1
      If UCase(ComboBox1 .Text) = UCase(ComboBox1 .Items.Item(iLo op)) Then
      bFound = True
      Next
      If bFound = False Then ComboBox1.Items .Add(ComboBox1. Text)
      End Sub


      Comment

      • Trammel

        #4
        Re: combobox

        "Trammel" <Me@Server.comw rote in message
        news:nmIzj.2028 50$LD6.118196@f e3.news.blueyon der.co.uk...
        "Trammel" <Me@Server.comw rote in message
        news:vcIzj.2028 38$LD6.179706@f e3.news.blueyon der.co.uk...
        >"enrico via DotNetMonster.c om" <u41845@uwewrot e in message
        >news:80ba5ee4c 99f8@uwe...
        >>how can i make a combobox that can store or add additional fields?
        >>
        >ComboBox1.Item s.Add("blah")
        >ComboBox1.Item s.Add("1234")
        >
        This can be expanded-on using a button labeled "+" or however you submit
        changes to the form/box:
        >
        Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
        System.EventArg s) Handles Button1.Click
        Dim iLoop As Long
        Dim bFound As Boolean = False
        For iLoop = 0 To ComboBox1.Items .Count - 1
        If UCase(ComboBox1 .Text) = UCase(ComboBox1 .Items.Item(iLo op)) Then
        bFound = True
        Next
        If bFound = False Then ComboBox1.Items .Add(ComboBox1. Text)
        End Sub
        Also, if you not bothered about people adding multiple words in different
        cases (Aka: Blah, blah, bLaH, etc) then it can be shortened to one line,
        like:

        Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
        System.EventArg s) Handles Button1.Click
        If Not ComboBox1.Items .Contains(Combo Box1.Text) Then
        ComboBox1.Items .Add(ComboBox1. Text)
        End Sub


        Comment

        • enrico via DotNetMonster.com

          #5
          RE: combobox

          i'm sorry, i can barely grasp what you meant about the .tostring() part. i'm
          not yet familiar on this language. can you elaborate more... tnx...

          --
          Message posted via http://www.dotnetmonster.com

          Comment

          • enrico via DotNetMonster.com

            #6
            Re: combobox

            thanks for the help trammel. i plainly use the code:

            Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
            System.EventArg s) Handles Button1.Click
            If Not ComboBox1.Items .Contains(Combo Box1.Text) Then
            ComboBox1.Items .Add(ComboBox1. Text)
            End Sub

            and it worked.. but is there a way that those new fields that were entered in
            the combobox will be part of the combobox's list? for example: the fields in
            the combobox are B, C, D then i entered A. every time i close my form and
            then reopen there are still 3 fields in the combobox. i want A be be part of
            that list, is it possible?

            --
            Message posted via http://www.dotnetmonster.com

            Comment

            • Cor Ligthert[MVP]

              #7
              Re: combobox

              Enriico,

              That depends completely from how you this combined box use.

              That combobox means in a way the same a multi tool.

              :-)

              Cor

              "enrico via DotNetMonster.c om" <u41845@uweschr eef in bericht
              news:80ba5ee4c9 9f8@uwe...
              how can i make a combobox that can store or add additional fields?
              >
              --
              Message posted via DotNetMonster.c om
              Best online pokies for real money in Australia and learn about safety and game mechanics in this comprehensive guide.

              >

              Comment

              Working...