Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7930489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:26:30+00:00 2026-06-03T20:26:30+00:00

First off im very new to C# im trying to recreate a application i

  • 0

First off im very new to C# im trying to recreate a application i created in Java.

I have 4 Listboxes. Each box will hold a list of values from the xml file.

listBox_year for the <Year>.
listBox_make for the <Make>.
listBox_model for the <Model>.
listBox_subModel is for the <sub-Model>.

So lets say i add all the years to the listBox_year with no duplicate years. Say i click on a year it will bring up all the Make of cars that have that year. Then i click on the Make and it will bring up the models for that Make thats under that Year etc…

with Java i was able to use a HashMap to make this work to where i can have multiple keys of the same name and i can search for what ever key in this case year is selected grab all the Makes or Values that has that year as a key.

Here is the XML format

<?xml version="1.0" encoding="utf-8" ?>
<vehicles>

  <Manufacturer>
    <Make>Subaru</Make>
    <Year>2010</Year>
    <Model>Impreza</Model>
    <Sub-Model>2.0i</Sub-Model>
    <Highway>36 MPG highway</Highway>
    <City>27 MPG city</City>
    <Price>$17,495</Price>
    <Description>
      Symmetrical All-Wheel Drive. 
      SUBARU BOXER® engine. 
      Seven airbags standard. 
      >Vehicle Dynamics Control (VDC). 
    </Description>
  </Manufacturer>

  <Manufacturer>
    <Make>Toyota</Make>
    <Year>2012</Year>
    <Model>Supra</Model>
    <Sub-Model>TT</Sub-Model>
    <Highway>22 MPG highway</Highway>
    <City>19 MPG city</City>
    <Price>$48,795</Price>
    <Description>
      16-inch aluminum-alloy wheels.
      6-speaker audio system w/iPod® control.
      Bluetooth® hands-free phone and audio.
      Available power moonroof.
    </Description>
  </Manufacturer>

  <Manufacturer>
    <Make>Subaru</Make>
    <Year>2011</Year>
    <Model>Impreza</Model>
    <Sub-Model>2.0i Limited</Sub-Model>
    <Highway>36 MPG highway</Highway>
    <City>27 MPG city</City>
    <Price>$18,795</Price>
    <Description>
      16-inch aluminum-alloy wheels. 
      6-speaker audio system w/iPod® control. 
      Bluetooth® hands-free phone and audio. 
      Available power moonroof.
    </Description>
  </Manufacturer>

  <Manufacturer>
    <Make>Subaru</Make>
    <Year>2011</Year>
    <Model>Impreza</Model>
    <Sub-Model>2.0i Limited</Sub-Model>
    <Highway>36 MPG highway</Highway>
    <City>27 MPG city</City>
    <Price>$18,795</Price>
    <Description>
      16-inch aluminum-alloy wheels.
      6-speaker audio system w/iPod® control.
      Bluetooth® hands-free phone and audio.
      Available power moonroof.
    </Description>
  </Manufacturer>

</vehicles>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:26:31+00:00Added an answer on June 3, 2026 at 8:26 pm

    The closest type to the java hashmap is the Dictionary. Since you need to have multiple items with the same key, I would use a Dictionary<int,List<Item>>.
    Here are some basic function you might need:

    void AddItem(int key, Item i, Dictionary<int,List<Item>> dict)
    {
       if (!dict.ContainsKey(key))
       {
          dict.Add(i,new List<Item>());
       }
       dict[key].Add(i);
    }
    
    List<Item> GetList(int key)
    {
       if (dict.ContainsKey(key))
       {
          return dict[key];
       }
       else
       {
          return new List<Item>(); // can also be null
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off I am very very new to shell scripting. I am trying to
First off, I am VERY new to Java, but wanted to know if it
First off I am very new to Objective C and iPhone programming. Now that
I'm trying to build an FAQ page. The page will have 2 columns: first
First off, a lil about me, i'm very new to GUI programming, especially with
First off let me just say I'm very new to coding so there are
I am writing my very first asp.net application and am trying to use the
First off, I'm very new to Azure. I've successfully deployed an ASP.NET MVC 3
First of all, let me say I am very new to rails, have been
First off, I've been given a very tight deadline (read: measured in minutes) to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.