![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Newbie
Join Date: Sep 2006
Posts: 11
Rep Power: 0
![]() |
I dont mean to be rude but I would reccomend looking at the MSDN Docs or the .net Framework SDK.
If you look up System.Windows.Forms namespace in the .net Class reference section you should find the ComboBox class with all the methods and properties all documented in great detail. There are also lots of examples given in the .net SDK docs. If all that fails and you have no idea then try google. Its all too easy to just ask in a forum. I have been reading this forum for about a year and I think if people read documentation and utlised google more there would be less need to post simple questions. You might take offence at what I have just said. I did not intend any and am only trying to help you become a better programmer. |
|
|
|
|
|
#12 |
|
Expert Programmer
|
I tried google and maybe i wasnt searching for the right stuff but i could not find anything useful. I will try the MSDN Docs (i forgot about those). And no you were not rude
__________________
|
|
|
|
|
|
#13 |
|
Expert Programmer
|
I can't seem to find anything in the MSDN Docs. Would someone be able to help me?
__________________
|
|
|
|
|
|
#14 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Comboboxes take single lines. If you want to add each line as a new entry into the combobox, do just that: split the text up (myString.Split('\n')) and add 'em all separately.
|
|
|
|
|
|
#15 |
|
Expert Programmer
|
ok i tried this but it gives String[] Array in the combo box
[php] sr1 = new StreamReader("c:\\collection.txt"); string myString = sr1.ReadToEnd(); sr1.Close(); comboBox1.Items.Add(myString.Split('\n')); [/php]
__________________
|
|
|
|
|
|
#16 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
You have to add them one at a time, I'm afraid.
csharp Syntax (Toggle Plain Text)
|
|
|
|
|
|
#17 | |
|
Programmer
Join Date: Dec 2005
Posts: 53
Rep Power: 3
![]() |
Quote:
csharp Syntax (Toggle Plain Text)
|
|
|
|
|
|
|
#18 |
|
Expert Programmer
|
Thanks Jason_Isom. Your suggestion worked.
__________________
|
|
|
|
|
|
#19 |
|
Expert Programmer
|
I lied... that is not the end of my problems
. What Jason said does work but it leaves a little rectangle shape after each line. I tried using \b after the \n but it will not accept that. Any Ideas?
__________________
|
|
|
|
|
|
#20 | |
|
Hobbyist Programmer
Join Date: Oct 2005
Posts: 211
Rep Power: 3
![]() |
Quote:
Here's two suggestions, do a .Trim on all of the elements (which would still require looping) or before the split replace the 0x0D 0x0A's with 0x0A's so that the split on \n works properly. -MBirchmeier |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 3 language combo. | Nebula | Coder's Corner Lounge | 9 | Dec 19th, 2005 1:34 PM |
| anoying problem with a combo box | cloud- | Visual Basic | 12 | May 28th, 2005 1:20 PM |
| Java Combo Boxes | Vengeance | Java | 0 | May 4th, 2005 9:02 AM |
| What are advantages of Data Combo and data list over simple combo and list box? | sham | Visual Basic | 1 | Apr 12th, 2005 4:11 AM |
| combo box in form.. | cloud- | HTML / XHTML / CSS | 5 | Mar 15th, 2005 3:21 PM |