Click here to Skip to main content
15,915,019 members
Home / Discussions / C#
   

C#

 
GeneralRe: Import data Pin
Nick Parker19-Nov-04 19:41
protectorNick Parker19-Nov-04 19:41 
GeneralRe: Import data Pin
bouli19-Nov-04 21:52
bouli19-Nov-04 21:52 
GeneralRe: Import data Pin
Nick Parker20-Nov-04 5:07
protectorNick Parker20-Nov-04 5:07 
GeneralRe: Import data Pin
bouli20-Nov-04 5:08
bouli20-Nov-04 5:08 
GeneralRe: Import data Pin
Heath Stewart19-Nov-04 10:13
protectorHeath Stewart19-Nov-04 10:13 
Generalenum Questions Pin
niceguyeddie19-Nov-04 6:31
niceguyeddie19-Nov-04 6:31 
GeneralRe: enum Questions Pin
Daniel Turini19-Nov-04 6:55
Daniel Turini19-Nov-04 6:55 
GeneralRe: enum Questions Pin
Dennis C. Dietrich19-Nov-04 6:59
Dennis C. Dietrich19-Nov-04 6:59 
niceguyeddie wrote:
What am I doing wrong here?

C# is type-safe and the type of KeyEventArgs.KeyCode[^] is Keys[^]. Therefore you have to explicitly cast the type:
if (e.KeyCode == (Keys)myKeys.SpecialKey1)
{
}

Lets say hypothetically that i'm making a video game and I want to make a button that fires a weapon.

I would definitely not use an enumeration to store the keys because a modern video game should provide a setup for reassigning the keys.

Best regards
Dennis
GeneralRe: enum Questions Pin
niceguyeddie19-Nov-04 7:25
niceguyeddie19-Nov-04 7:25 
GeneralRe: enum Questions Pin
Heath Stewart19-Nov-04 8:12
protectorHeath Stewart19-Nov-04 8:12 
GeneralRe: enum Questions Pin
Daniel Turini20-Nov-04 5:47
Daniel Turini20-Nov-04 5:47 
GeneralRe: enum Questions Pin
niceguyeddie22-Nov-04 6:22
niceguyeddie22-Nov-04 6:22 
GeneralRe: enum Questions Pin
Daniel Turini22-Nov-04 6:24
Daniel Turini22-Nov-04 6:24 
Generalpicturebox and imagelist in C# Pin
youssef19-Nov-04 4:44
youssef19-Nov-04 4:44 
GeneralRe: picturebox and imagelist in C# Pin
Heath Stewart19-Nov-04 8:13
protectorHeath Stewart19-Nov-04 8:13 
GeneralRe: picturebox and imagelist in C# Pin
youssef19-Nov-04 8:37
youssef19-Nov-04 8:37 
GeneralRasAPI in C# - connecting after failure Pin
Roland Bär19-Nov-04 3:16
Roland Bär19-Nov-04 3:16 
GeneralRe: RasAPI in C# - connecting after failure Pin
Daniel Turini19-Nov-04 6:53
Daniel Turini19-Nov-04 6:53 
GeneralRe: RasAPI in C# - connecting after failure Pin
Roland Bär21-Nov-04 23:25
Roland Bär21-Nov-04 23:25 
GeneralWindows Service and Sql Server Pin
Anonymous19-Nov-04 2:41
Anonymous19-Nov-04 2:41 
GeneralRe: Windows Service and Sql Server Pin
Dennis C. Dietrich19-Nov-04 3:15
Dennis C. Dietrich19-Nov-04 3:15 
GeneralRe: Windows Service and Sql Server Pin
Daniel Turini19-Nov-04 6:49
Daniel Turini19-Nov-04 6:49 
GeneralRe: Windows Service and Sql Server Pin
Steven Campbell19-Nov-04 7:37
Steven Campbell19-Nov-04 7:37 
GeneralRe: Windows Service and Sql Server Pin
Anonymous19-Nov-04 19:13
Anonymous19-Nov-04 19:13 
GeneralRe: Windows Service and Sql Server Pin
Dennis C. Dietrich20-Nov-04 3:43
Dennis C. Dietrich20-Nov-04 3: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.