combobox
Collapse
This topic is closed.
X
X
-
enrico via DotNetMonster.comTags: None -
Trammel
Re: combobox
"enrico via DotNetMonster.c om" <u41845@uwewrot e in message
news:80ba5ee4c9 9f8@uwe...ComboBox1.Items .Add("blah")how can i make a combobox that can store or add additional fields?
ComboBox1.Items .Add("1234")
-
Trammel
Re: combobox
"Trammel" <Me@Server.comw rote in message
news:vcIzj.2028 38$LD6.179706@f e3.news.blueyon der.co.uk...This can be expanded-on using a button labeled "+" or however you submit"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")
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
Re: combobox
"Trammel" <Me@Server.comw rote in message
news:nmIzj.2028 50$LD6.118196@f e3.news.blueyon der.co.uk...Also, if you not bothered about people adding multiple words in different"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
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
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
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]
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...Comment
Comment