Click here to Skip to main content
15,886,689 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# dice program (combobox selection) Pin
Angel_788-May-12 3:37
Angel_788-May-12 3:37 
GeneralRe: C# dice program (combobox selection) Pin
BobJanova8-May-12 4:38
BobJanova8-May-12 4:38 
AnswerRe: C# dice program (combobox selection) Pin
PIEBALDconsult8-May-12 3:12
mvePIEBALDconsult8-May-12 3:12 
GeneralRe: C# dice program (combobox selection) Pin
Angel_788-May-12 3:50
Angel_788-May-12 3:50 
GeneralRe: C# dice program (combobox selection) Pin
PIEBALDconsult8-May-12 18:39
mvePIEBALDconsult8-May-12 18:39 
GeneralRe: C# dice program (combobox selection) Pin
Angel_789-May-12 2:55
Angel_789-May-12 2:55 
GeneralRe: C# dice program (combobox selection) Pin
PIEBALDconsult9-May-12 3:20
mvePIEBALDconsult9-May-12 3:20 
GeneralRe: C# dice program (combobox selection) Pin
Angel_789-May-12 5:53
Angel_789-May-12 5:53 
Something like this?
public Form1()
{
    InitializeComponent();
    ComboBox combo = new ComboBox();
    combo.DataSource = Enum.GetValues(typeof(DiceValue));

    //comboBox1.Items.Add("3 sided die");
    //comboBox1.Items.Add("4 sided die");
    //comboBox1.Items.Add("5 sided die");
    //comboBox1.Items.Add("6 sided die");
    //comboBox1.DisplayMember = "Name";
    //comboBox1.ValueMember = "Value";
}

public enum DiceValue
{
    ("3 sided die") = 3,
    ("4 sided die") = 4,
    ("5 sided die") = 5,
    ("6 sided die") = 6,
}

Gives me an error in the enum "Identifier" expected.

Commented out my last population of the comboBox if I still need to use that. Not sure if I am on the right track here.

Then if I use a enum I need to change my button that is
private void button1_Click(object sender, EventArgs e)

to a private enum?

This comboBox really made me pull some hairs but you need to learn somewhere Smile | :)
GeneralRe: C# dice program (combobox selection) Pin
PIEBALDconsult10-May-12 3:09
mvePIEBALDconsult10-May-12 3:09 
GeneralRe: C# dice program (combobox selection) Pin
Angel_7810-May-12 6:07
Angel_7810-May-12 6:07 
GeneralRe: C# dice program (combobox selection) Pin
PIEBALDconsult10-May-12 15:48
mvePIEBALDconsult10-May-12 15:48 
GeneralRe: C# dice program (combobox selection) Pin
Angel_7811-May-12 15:57
Angel_7811-May-12 15:57 
GeneralRe: C# dice program (combobox selection) Pin
PIEBALDconsult12-May-12 6:23
mvePIEBALDconsult12-May-12 6:23 
GeneralRe: C# dice program (combobox selection) Pin
Angel_7812-May-12 12:12
Angel_7812-May-12 12:12 
GeneralRe: C# dice program (combobox selection) Pin
PIEBALDconsult13-May-12 5:31
mvePIEBALDconsult13-May-12 5:31 
GeneralRe: C# dice program (combobox selection) Pin
Angel_7813-May-12 10:09
Angel_7813-May-12 10:09 
GeneralRe: C# dice program (combobox selection) Pin
PIEBALDconsult13-May-12 16:34
mvePIEBALDconsult13-May-12 16:34 
GeneralRe: C# dice program (combobox selection) Pin
Angel_7814-May-12 10:36
Angel_7814-May-12 10:36 
GeneralRe: C# dice program (combobox selection) Pin
PIEBALDconsult14-May-12 14:11
mvePIEBALDconsult14-May-12 14:11 
Questionerror on exiting form wit datagridview containing comboboxcell Pin
markoVVVV8-May-12 1:14
markoVVVV8-May-12 1:14 
AnswerRe: error on exiting form wit datagridview containing comboboxcell Pin
Eddy Vluggen8-May-12 5:03
professionalEddy Vluggen8-May-12 5:03 
AnswerRe: error on exiting form wit datagridview containing comboboxcell Pin
Apocalypse Now8-May-12 14:58
Apocalypse Now8-May-12 14:58 
QuestionReg: Loading text file(size 100 MB) in Richtextbox Pin
Member 23893798-May-12 1:00
Member 23893798-May-12 1:00 
AnswerRe: Reg: Loading text file(size 100 MB) in Richtextbox Pin
Luc Pattyn8-May-12 2:10
sitebuilderLuc Pattyn8-May-12 2:10 
AnswerRe: Reg: Loading text file(size 100 MB) in Richtextbox Pin
Pete O'Hanlon8-May-12 2:26
mvePete O'Hanlon8-May-12 2:26 

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.