Keys.PageDown.tostring = Next?

false74

Well-known member
Joined
Aug 4, 2010
Messages
76
Programming Experience
Beginner
I have a Keys variable that needs to be returned as a string. However When I try Keys.Pagedown.toString it returns "Next" and NOT "PageDown"

I know that Next shares the PageDown key so that might be the issue.
The interesting thing is Keys.PageUp.toString returns "PageUp" and NOT prior (the other key that is shared with it).

I have also tried using the keycode (34) instead of the enum, same result, obviously.

Is there a fix for this?
 
I thought that I might have had a solution but it behaves in the exact opposite way.
MessageBox.Show(Keys.PageUp.ToString())
MessageBox.Show(Keys.PageDown.ToString())

MessageBox.Show([Enum].GetName(GetType(Keys), Keys.PageUp))
MessageBox.Show([Enum].GetName(GetType(Keys), Keys.PageDown))
I guess that it has to do with the order in which the values are declared and, frankly, I can't think of a way around it.
 
Back
Top