Click here to Skip to main content
15,905,233 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Need Help with SendInput for key commands Pin
Dominik Reichl20-Apr-08 2:04
Dominik Reichl20-Apr-08 2:04 
QuestionHow to make AutoGeneration Code tools ? Pin
hdv21219-Apr-08 10:37
hdv21219-Apr-08 10:37 
AnswerRe: How to make AutoGeneration Code tools ? Pin
Mycroft Holmes19-Apr-08 17:31
professionalMycroft Holmes19-Apr-08 17:31 
GeneralDon't show ToolStripMenuItem in Taskbar Pin
Jordanwb19-Apr-08 9:56
Jordanwb19-Apr-08 9:56 
GeneralRe: Don't show ToolStripMenuItem in Taskbar Pin
hostar16-Oct-14 6:31
hostar16-Oct-14 6:31 
GeneralRead/write custom events to XML Pin
xax19-Apr-08 7:43
xax19-Apr-08 7:43 
GeneralRe: Read/write custom events to XML Pin
Guffa19-Apr-08 10:25
Guffa19-Apr-08 10:25 
GeneralRe: Read/write custom events to XML Pin
xax20-Apr-08 9:00
xax20-Apr-08 9:00 
QuestionIP version 6 input control ? Pin
nesaver8519-Apr-08 7:25
nesaver8519-Apr-08 7:25 

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.