Click here to Skip to main content
15,906,708 members
Home / Discussions / C#
   

C#

 
GeneralRe: Exception not thrown when it should be Pin
tachobg15-Aug-06 3:28
tachobg15-Aug-06 3:28 
GeneralRe: Exception not thrown when it should be Pin
tachobg15-Aug-06 3:36
tachobg15-Aug-06 3:36 
QuestionOpen a MainMenu menu [modified] Pin
myNameIsRon14-Aug-06 8:13
myNameIsRon14-Aug-06 8:13 
QuestionHow to refresh background application when a process is running? [modified] Pin
yan8814-Aug-06 8:08
yan8814-Aug-06 8:08 
AnswerRe: How to refresh background application when a process is running? Pin
Mike Dimmick14-Aug-06 16:39
Mike Dimmick14-Aug-06 16:39 
GeneralRe: How to refresh background application when a process is running? Pin
yan8815-Aug-06 7:35
yan8815-Aug-06 7:35 
Questionlist view Pin
TAREQ F ABUZUHRI14-Aug-06 7:26
TAREQ F ABUZUHRI14-Aug-06 7:26 
QuestionEnum within a button click event on a form - why compile error [modified] Pin
LuluSailor14-Aug-06 6:42
LuluSailor14-Aug-06 6:42 
private void button1_Click(object sender, EventArgs e)
{

enum MyTemp
{
cold = 0,
fp = 32
}

day1Miles.Text = textBox1.Text;

}

I get an error on 2 ( error says: } expected )

What am I missing in the concepts here? Why can't I define an enumerated constant at top of the button click? I can replace the enum statement with something like int cold = 0; and it works fine, so why can't I put an enum statement here?

For example this compiles without error:

private void button1_Click(object sender, EventArgs e)
{

int cold = 0;

day1Miles.Text = textBox1.Text;
}


-- modified at 12:49 Monday 14th August, 2006
AnswerRe: Enum within a button click event on a form - why compile error Pin
Andrew Rissing14-Aug-06 7:00
Andrew Rissing14-Aug-06 7:00 
GeneralRe: Enum within a button click event on a form - why compile error Pin
LuluSailor14-Aug-06 7:11
LuluSailor14-Aug-06 7:11 
GeneralRe: Enum within a button click event on a form - why compile error Pin
Rob Graham14-Aug-06 7:50
Rob Graham14-Aug-06 7:50 
GeneralRe: Enum within a button click event on a form - why compile error Pin
LuluSailor14-Aug-06 9:16
LuluSailor14-Aug-06 9:16 
GeneralRe: Enum within a button click event on a form - why compile error Pin
Dave Kreskowiak14-Aug-06 10:36
mveDave Kreskowiak14-Aug-06 10:36 
GeneralRe: Enum within a button click event on a form - why compile error Pin
LuluSailor14-Aug-06 11:42
LuluSailor14-Aug-06 11:42 
Questionsystem properties Pin
Harikrk14-Aug-06 6:40
Harikrk14-Aug-06 6:40 
AnswerRe: system properties Pin
Rob Graham14-Aug-06 7:59
Rob Graham14-Aug-06 7:59 
Questioncreating OCX Pin
Harikrk14-Aug-06 5:27
Harikrk14-Aug-06 5:27 
AnswerRe: creating OCX Pin
Rob Graham14-Aug-06 5:42
Rob Graham14-Aug-06 5:42 
GeneralRe: creating OCX Pin
Harikrk14-Aug-06 5:55
Harikrk14-Aug-06 5:55 
GeneralRe: creating OCX Pin
Rob Graham14-Aug-06 6:17
Rob Graham14-Aug-06 6:17 
GeneralRe: creating OCX Pin
Harikrk14-Aug-06 6:22
Harikrk14-Aug-06 6:22 
GeneralRe: creating OCX Pin
Rob Graham14-Aug-06 7:32
Rob Graham14-Aug-06 7:32 
GeneralRe: creating OCX Pin
Judah Gabriel Himango14-Aug-06 6:22
sponsorJudah Gabriel Himango14-Aug-06 6:22 
GeneralRe: creating OCX Pin
Harikrk14-Aug-06 6:24
Harikrk14-Aug-06 6:24 
AnswerRe: creating OCX Pin
Judah Gabriel Himango14-Aug-06 5:43
sponsorJudah Gabriel Himango14-Aug-06 5:43 

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.