By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

how do i get string into.........

P: n/a
how do i get string into combobox? i am working on irc chat similar to
mirc.

i put in declaration section:

Dim szCommand() As String = {"ACTION", "JOIN", "PART", "QUIT",
"NOTICE", "KICK", "BAN", "INVITE", "TOPIC", "MODE", "AWAY", "CHAT",
"OTHER", "USER"}

and in sub new()

For iCommand As Integer = 0 To szCommand.Length
cboCommand.Items.Add(iCommand) ===> display 0 to 14
instead of string
Next
end sub

regards

Nov 21 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a

"Supra" <su*****@rogers.com> wrote in message
news:mR**********************@twister01.bloor.is.n et.cable.rogers.com...
how do i get string into combobox? i am working on irc chat similar to
mirc.

i put in declaration section:

Dim szCommand() As String = {"ACTION", "JOIN", "PART", "QUIT",
"NOTICE", "KICK", "BAN", "INVITE", "TOPIC", "MODE", "AWAY", "CHAT",
"OTHER", "USER"}

and in sub new()

For iCommand As Integer = 0 To szCommand.Length
cboCommand.Items.Add(iCommand) ===> display 0 to 14
instead of string
Next
end sub

regards

Use the integer as the subscript into your array of strings.
(warning. code is untested)
For i as Integer = 0 To szCommand.Length - 1
cboCommandItems.Add(szCommand(i))
Next

Note the differences. First the loop control restricts the repetitions to 14
(0 - 13) to match the number of strings in your array. Second, strings are
added to the combo box.

Hope this helps.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 21 '05 #2

P: n/a
cboCommand.Items.Add(szCommand(iCommand))

"Supra" <su*****@rogers.com> wrote in message
news:mR**********************@twister01.bloor.is.n et.cable.rogers.com...
how do i get string into combobox? i am working on irc chat similar to
mirc.

i put in declaration section:

Dim szCommand() As String = {"ACTION", "JOIN", "PART", "QUIT",
"NOTICE", "KICK", "BAN", "INVITE", "TOPIC", "MODE", "AWAY", "CHAT",
"OTHER", "USER"}

and in sub new()

For iCommand As Integer = 0 To szCommand.Length
cboCommand.Items.Add(iCommand) ===> display 0 to 14
instead of string
Next
end sub

regards
Nov 21 '05 #3

P: n/a
thank peter. i got it working
regards

Peter van der Goes wrote:
"Supra" <su*****@rogers.com> wrote in message
news:mR**********************@twister01.bloor.is. net.cable.rogers.com...

how do i get string into combobox? i am working on irc chat similar to
mirc.

i put in declaration section:

Dim szCommand() As String = {"ACTION", "JOIN", "PART", "QUIT",
"NOTICE", "KICK", "BAN", "INVITE", "TOPIC", "MODE", "AWAY", "CHAT",
"OTHER", "USER"}

and in sub new()

For iCommand As Integer = 0 To szCommand.Length
cboCommand.Items.Add(iCommand) ===> display 0 to 14
instead of string
Next
end sub

regards

Use the integer as the subscript into your array of strings.
(warning. code is untested)
For i as Integer = 0 To szCommand.Length - 1
cboCommandItems.Add(szCommand(i))
Next

Note the differences. First the loop control restricts the repetitions to 14
(0 - 13) to match the number of strings in your array. Second, strings are
added to the combo box.

Hope this helps.


Nov 21 '05 #4

P: n/a
* Supra <su*****@rogers.com> scripsit:
how do i get string into combobox? i am working on irc chat similar
to mirc.
i put in declaration section:

Dim szCommand() As String = {"ACTION", "JOIN", "PART", "QUIT",
"NOTICE", "KICK", "BAN", "INVITE", "TOPIC", "MODE", "AWAY", "CHAT",
"OTHER", "USER"}


\\\
Me.ComboBox1.Items.AddRange(szCommand)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #5

P: n/a
On Thu, 19 Aug 2004 12:15:14 GMT, Supra wrote:
Dim szCommand() As String = {"ACTION", "JOIN", "PART", "QUIT",
"NOTICE", "KICK", "BAN", "INVITE", "TOPIC", "MODE", "AWAY", "CHAT",
"OTHER", "USER"}

For iCommand As Integer = 0 To szCommand.Length


Instead of a for loop, call the AddRange method:

cboCommand.Items.AddRange(szCommand)
--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #6

P: n/a
i didn't even know addrange .
thank
regards

Herfried K. Wagner [MVP] wrote:
* Supra <su*****@rogers.com> scripsit:

how do i get string into combobox? i am working on irc chat similar
to mirc.
i put in declaration section:

Dim szCommand() As String = {"ACTION", "JOIN", "PART", "QUIT",
"NOTICE", "KICK", "BAN", "INVITE", "TOPIC", "MODE", "AWAY", "CHAT",
"OTHER", "USER"}


\\\
Me.ComboBox1.Items.AddRange(szCommand)
///


Nov 21 '05 #7

P: n/a
that would be great for shortcut instead of looping, chris.
thank to all guys
regards

Chris Dunaway wrote:
On Thu, 19 Aug 2004 12:15:14 GMT, Supra wrote:
Dim szCommand() As String = {"ACTION", "JOIN", "PART", "QUIT",
"NOTICE", "KICK", "BAN", "INVITE", "TOPIC", "MODE", "AWAY", "CHAT",
"OTHER", "USER"}

For iCommand As Integer = 0 To szCommand.Length


Instead of a for loop, call the AddRange method:

cboCommand.Items.AddRange(szCommand)


Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.