473,385 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
7 1290

"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
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
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
* 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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: oliver | last post by:
hi there i'm experimanting with imaplib and came across stringts like (\HasNoChildren) "." "INBOX.Sent Items" in which the quotes are part of the string. now i try to convert this into a...
20
by: hagai26 | last post by:
I am looking for the best and efficient way to replace the first word in a str, like this: "aa to become" -> "/aa/ to become" I know I can use spilt and than join them but I can also use regular...
5
by: John Baro | last post by:
I have a richtextbox which I want the "literal" rtf of. richtextbox.rtf returns {\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033\\uc1 }\r\n\0 when i put this into a string I get...
7
by: Donovan | last post by:
I can't believe this is causing me as much difficulty as it is, but I have an Infragistics UltraTreeview control that I want to persist whatever the user has in the tree. It has a method SaveAsXml...
17
by: Chad Myers | last post by:
I've been perf testing an application of mine and I've noticed that there are a lot (and I mean A LOT -- megabytes and megabytes of 'em) System.String instances being created. I've done some...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
20
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just...
18
by: Ger | last post by:
I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it? I found...
4
by: JohnR | last post by:
Hi all, I'm finally sick and tired of manually generating get/set properties for each private variable in a class so I'm trying to create a macro to do it. I'm stuck because I can't figure out...
1
by: kellysgirl | last post by:
Now what you are going to see posted here is both the set of instructions I was given..and the code I have written. The instructions I was given are as follows In this case, you will create...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.