PC Review


Reply
Thread Tools Rate Thread

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

 
 
Supra
Guest
Posts: n/a
 
      19th Aug 2004
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

 
Reply With Quote
 
 
 
 
Peter van der Goes
Guest
Posts: n/a
 
      19th Aug 2004

"Supra" <(E-Mail Removed)> wrote in message
news:mR0Vc.1809004$(E-Mail Removed)...
> 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.


 
Reply With Quote
 
Shiva
Guest
Posts: n/a
 
      19th Aug 2004
cboCommand.Items.Add(szCommand(iCommand))

"Supra" <(E-Mail Removed)> wrote in message
news:mR0Vc.1809004$(E-Mail Removed)...
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


 
Reply With Quote
 
Supra
Guest
Posts: n/a
 
      19th Aug 2004
thank peter. i got it working
regards

Peter van der Goes wrote:

>"Supra" <(E-Mail Removed)> wrote in message
>news:mR0Vc.1809004$(E-Mail Removed)...
>
>
>>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.
>
>
>


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      19th Aug 2004
* Supra <(E-Mail Removed)> 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/>
 
Reply With Quote
 
Chris Dunaway
Guest
Posts: n/a
 
      19th Aug 2004
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.
 
Reply With Quote
 
Supra
Guest
Posts: n/a
 
      19th Aug 2004
i didn't even know addrange .
thank
regards

Herfried K. Wagner [MVP] wrote:

>* Supra <(E-Mail Removed)> 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)
>///
>
>
>


 
Reply With Quote
 
Supra
Guest
Posts: n/a
 
      19th Aug 2004
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)
>
>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make two references to one string that stay refered to the same string reguardless of the changing value in the string? Daniel Microsoft Dot NET 7 12th Nov 2004 09:08 AM
how to make two references to one string that stay refered to the same string reguardless of the changing value in the string? Daniel Microsoft C# .NET 10 3rd Nov 2004 03:26 PM
Cannot create an object of type 'System.String[]' from its string representation 'String[] Array' for the 'Options' property. Hessam Microsoft C# .NET 0 8th Aug 2003 09:45 AM
Re: Converting a string to a string that contains the ASCII values of each letter in the origional string Mikael Jansson Microsoft C# .NET 0 31st Jul 2003 08:42 PM
Re: Converting a string to a string that contains the ASCII values of each letter in the origional string Frank Oquendo Microsoft C# .NET 0 31st Jul 2003 08:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:49 PM.