Click here to Skip to main content
15,900,725 members
Home / Discussions / C#
   

C#

 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Martin#10-Jul-07 1:18
Martin#10-Jul-07 1:18 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Vikram A Punathambekar10-Jul-07 4:30
Vikram A Punathambekar10-Jul-07 4:30 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Martin#10-Jul-07 4:39
Martin#10-Jul-07 4:39 
AnswerRe: unable to cast object of type 'X' to type 'X' Pin
AFSEKI10-Jul-07 6:31
AFSEKI10-Jul-07 6:31 
QuestionSend a string to another program Pin
suntromantralalalala9-Jul-07 5:08
suntromantralalalala9-Jul-07 5:08 
AnswerRe: Send a string to another program Pin
Luc Pattyn9-Jul-07 6:51
sitebuilderLuc Pattyn9-Jul-07 6:51 
QuestionIterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 5:05
Shy Agam9-Jul-07 5:05 
AnswerRe: Iterating through all values of an ORed enum variable... Pin
Martin#9-Jul-07 5:39
Martin#9-Jul-07 5:39 
Hello,

First let me say that I think it's a very good question!
And I have no idea if there is a nice solution for that.
I looked thre the Enum members and haven't found something obvious.

An (very ugly) solution (or let's say workaround), would be.
Use the ToString() method to get a string like: "Control, A";
Than Trim and Split it.
and with the help of Parse you will get the Enum Members:
iterate over the stringarray which is returned from the string.Split(',') method.
Keys actKey = (Keys)Enum.Parse(typeof(Keys), stringarray[x], true);


I hope there is a nicer solution out there! (But maybe it helps you)

All the best,

Martin

All the best,

Martin

AnswerRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 7:08
sitebuilderLuc Pattyn9-Jul-07 7:08 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
PhilDanger9-Jul-07 7:20
PhilDanger9-Jul-07 7:20 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 8:12
Shy Agam9-Jul-07 8:12 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 8:20
sitebuilderLuc Pattyn9-Jul-07 8:20 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 8:44
sitebuilderLuc Pattyn9-Jul-07 8:44 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 8:51
Shy Agam9-Jul-07 8:51 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Martin#9-Jul-07 9:06
Martin#9-Jul-07 9:06 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 9:18
sitebuilderLuc Pattyn9-Jul-07 9:18 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 9:27
sitebuilderLuc Pattyn9-Jul-07 9:27 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Martin#9-Jul-07 9:54
Martin#9-Jul-07 9:54 
AnswerRe: Iterating through all values of an ORed enum variable... Pin
PhilDanger9-Jul-07 7:17
PhilDanger9-Jul-07 7:17 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 8:02
Shy Agam9-Jul-07 8:02 
AnswerRe: Iterating through all values of an ORed enum variable... Pin
PhilDanger9-Jul-07 10:55
PhilDanger9-Jul-07 10:55 
QuestionHow to play at the same time 2 or more sounds Pin
mayhem709-Jul-07 4:58
mayhem709-Jul-07 4:58 
AnswerRe: How to play at the same time 2 or more sounds Pin
mav.northwind9-Jul-07 19:21
mav.northwind9-Jul-07 19:21 
AnswerRe: How to play at the same time 2 or more sounds Pin
Hesham Yassin9-Jul-07 22:38
Hesham Yassin9-Jul-07 22:38 
Questionhow to sort datagridview ? (a numeric field) Pin
cmpeng349-Jul-07 4:53
cmpeng349-Jul-07 4:53 

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.