Post: Comboboxes & Lists
03-18-2015, 09:36 AM #1
seanhellen
Are you high?
(adsbygoogle = window.adsbygoogle || []).push({}); Hey everyone - I was wondering what is is the easiest way to make a few lists, then depending on the option selected in combobox1, it will populate combobox2.

What I have is 2 comboboxes - Make and Model. I know I can add stuff by typing

    comobobox1.Items.Add("Suzuki");


but doing that for every Make and model is gonna be a ballache. So I was wondering if someone knew of a way I can make some lists eg;-

-Make (Suzuki, Honda, etc)
-Suzuki Models
-Honda Models
-etc

so that I can select Suzuki (eg) in combobox1 and it will populate combobox2 with Suzuki Models
(adsbygoogle = window.adsbygoogle || []).push({});
03-20-2015, 06:43 PM #11
jagex
Gym leader
edit: misread your question. You want to put items in a txtfile now?

You'll get a better answer from stackoverflow/vbforums. Try posting your question on those sites.
03-20-2015, 07:38 PM #12
seanhellen
Are you high?
Haha. Sorry about that. My post posted after your reply lol.

I was adding to comboboxes by using items.addrange

I am only wanting to use seperate .txt files as they can be editted and saved. If i can do this easily in-app, it would be better
03-20-2015, 08:47 PM #13
jagex
Gym leader
I don't think you can edit a specific line in a text file, you would just have to rewrite it.
03-21-2015, 06:33 AM #14
seanhellen
Are you high?
Ah. Ok I may havd mis-read it. Ill give your way a go first and see how I get on then. Thanks Smile
03-21-2015, 12:20 PM #15
Default Avatar
Oneup
Guest
Originally posted by jagex View Post
I don't think you can edit a specific line in a text file, you would just have to rewrite it.


No you can. You iterate through each line in a streamreader.
03-21-2015, 02:07 PM #16
jagex
Gym leader
Originally posted by 1UP View Post
No you can. You iterate through each line in a streamreader.


It will still rewrite the whole file.
03-21-2015, 02:12 PM #17
Default Avatar
Oneup
Guest
Originally posted by jagex View Post
It will still rewrite the whole file.


Sorry I said stream reader , I meant stream writer and no you can specify a line number.
However I think what you are talking about is that the entire file is going to be saved no matter what right? In which case yes, there isn't a way around that.
03-21-2015, 04:04 PM #18
seanhellen
Are you high?
Yeah. Ill have makes in a combobox (they are set) and models in another...obviously this combobox changes depending on the make...i just needed a way of adding a make and model to the boxes in case i forgot 1...i tried databases but got lost very quickly lol
03-21-2015, 06:22 PM #19
jagex
Gym leader
Did you try MySQL? Its very simple to use.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo