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 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.
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
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.
* 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/>
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.
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) ///
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) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |