Click here to Skip to main content
15,921,452 members
Home / Discussions / C#
   

C#

 
GeneralRe: root in managed heap Pin
George_George20-Apr-08 23:46
George_George20-Apr-08 23:46 
GeneralRe: root in managed heap Pin
Luc Pattyn21-Apr-08 0:32
sitebuilderLuc Pattyn21-Apr-08 0:32 
GeneralRe: root in managed heap Pin
George_George21-Apr-08 1:08
George_George21-Apr-08 1:08 
GeneralRe: root in managed heap Pin
Luc Pattyn21-Apr-08 1:23
sitebuilderLuc Pattyn21-Apr-08 1:23 
GeneralRe: root in managed heap Pin
George_George21-Apr-08 2:04
George_George21-Apr-08 2:04 
GeneralRe: root in managed heap Pin
Luc Pattyn21-Apr-08 4:00
sitebuilderLuc Pattyn21-Apr-08 4:00 
GeneralRe: root in managed heap Pin
George_George21-Apr-08 4:16
George_George21-Apr-08 4:16 
GeneralFileStream.Read(); Pin
Ian Uy19-Apr-08 18:33
Ian Uy19-Apr-08 18:33 
GeneralRe: FileStream.Read(); Pin
Zoltan Balazs20-Apr-08 0:11
Zoltan Balazs20-Apr-08 0:11 
GeneralRe: FileStream.Read(); Pin
Ian Uy20-Apr-08 1:14
Ian Uy20-Apr-08 1:14 
GeneralComboBox not properly adding items Pin
Jordanwb19-Apr-08 14:10
Jordanwb19-Apr-08 14:10 
GeneralRe: ComboBox not properly adding items Pin
Luc Pattyn19-Apr-08 15:12
sitebuilderLuc Pattyn19-Apr-08 15:12 
GeneralRe: ComboBox not properly adding items Pin
Jordanwb19-Apr-08 15:53
Jordanwb19-Apr-08 15:53 
GeneralRe: ComboBox not properly adding items Pin
Luc Pattyn19-Apr-08 16:09
sitebuilderLuc Pattyn19-Apr-08 16:09 
GeneralRe: ComboBox not properly adding items Pin
Jordanwb19-Apr-08 16:27
Jordanwb19-Apr-08 16:27 
GeneralRe: ComboBox not properly adding items Pin
Luc Pattyn19-Apr-08 22:59
sitebuilderLuc Pattyn19-Apr-08 22:59 
GeneralRe: ComboBox not properly adding items Pin
Jordanwb20-Apr-08 4:09
Jordanwb20-Apr-08 4:09 
Okee Dokey.

Category class (irrelevant code ommitted)

<code>
public class Category : ToolStripMenuItem
{
public Category(int id, string name)
{
this.id = id;
this.Text = name;

this.sub_items = new List&lt;Program&gt;();
}

public override string ToString()
{
return this.Text;
}
}
</code>

Where I add the Categories to the ComboBox:

<code>
public partial class RemoveCategory : Form
{
public RemoveCategory(AccessReader database, HashMap&lt;int, Category&gt; categories)
{
InitializeComponent();

this.database = database;
this.categories = categories;

this.cmb_categories.Items.AddRange(categories.ToArray());
this.cmb_categories.SelectedIndex = 0;
}
}
</code>

The HashMap class is a class that I made that maps a key (in this case int) to a value (in this case Category), the ToArray() method returns an array of Categories that contain all the values in the HashMap. In the callback for when the button is clicked, the SelectedItem property of the ComboBox is no long returning null but is returning an object which is casted into a Category.
GeneralRe: ComboBox not properly adding items Pin
Luc Pattyn20-Apr-08 13:30
sitebuilderLuc Pattyn20-Apr-08 13:30 
GeneralRe: ComboBox not properly adding items [modified] Pin
Jordanwb20-Apr-08 16:07
Jordanwb20-Apr-08 16:07 
GeneralRe: ComboBox not properly adding items Pin
Luc Pattyn20-Apr-08 16:44
sitebuilderLuc Pattyn20-Apr-08 16:44 
GeneralRe: ComboBox not properly adding items Pin
Jordanwb21-Apr-08 2:46
Jordanwb21-Apr-08 2:46 
Question.NET certification? Pin
YAI19-Apr-08 13:58
YAI19-Apr-08 13:58 
AnswerRe: .NET certification? Pin
leckey19-Apr-08 14:48
leckey19-Apr-08 14:48 
AnswerRe: .NET certification? Pin
Zoltan Balazs19-Apr-08 23:19
Zoltan Balazs19-Apr-08 23:19 
QuestionNeed Help with SendInput for key commands Pin
Luke Dyer19-Apr-08 12:05
Luke Dyer19-Apr-08 12:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.