![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3
![]() |
Linked List and List Boxes
In my spare time, I'm trying my hand with Visual C++, and what I want to do is have a linked list of Nodes containing string and int variables. I would then like a ListBox in the form to display the data in the nodes.
Could somebody be so kind as to help me out? I'm brand new to Visual and still trying to find my way around. |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4
![]() |
We're here to help. Write some code and post here if you're having any problems. Be sure to read the "How to post a question" and "Forum Rules" thread.
__________________
PFO - My daily dose of technology. |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3
![]() |
Sigh, I suppose I should try and fail first :p
I guess what I really want to ask is whether there is a built in function to do it. If not I can probably work out a function to do it. On top of that, what kind of variables can be assigned as text in a text box? For example, I tried to do this: int Item = 4500; txtItem->Text = 4500; And got an error about type mismatches, though it will work with strings. Also, how can I access form items from a file other than Form.h? For instance, in my main code file, I went: Form1::MyTextBox->Text = "something"; but I can't use the -> operator, or the :: operator. |
|
|
|
|
|
#4 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3
![]() |
Actually, I did search, and found nothing pertaining to my original question of using Linked Lists combined with Visual List Boxes.
|
|
|
|
|
|
#6 | ||
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Quote:
txtItem->Text = "4500". Quote:
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
||
|
|
|
|
|
#7 | |
|
Hobbyist
Join Date: Sep 2005
Posts: 266
Rep Power: 4
![]() |
Quote:
BTW what the heck are "Visual List Boxes", and if you're using .NET wouldn't it nice to say so? |
|
|
|
|
|
|
#8 | |
|
Programmer
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3
![]() |
I'd love to tell you, but to be honest I'm not really sure I am. It would seem probable I'm using .net though. I just downloaded Visual Studio Express Edition, and starting fiddling with forms and such.
As for a Visual List Box, I suppose it's fairly redundant, as it's just a ListBox. Quote:
Right above where I tried that, I had: Application::Run(gcnew Form1()); And I have a complete Form.h and such that Studio made for me. |
|
|
|
|
|
|
#9 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#10 |
|
Programmer
|
Why not use the built in array types? The ArrayList would work fine. All you need to do is create an object that has an int and a string and then load them into the arraylist, cast them back to the class when you wanna use them.
Chi |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|