Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

Using Arrow Keys

$
0
0

I am trying to capture the use of the arrow keys in my code and it is not being recognized. It seems as if the keys are reserved for the form itself and when I press the arrow keys they just move from one button to the next similar to using the Tab key to maneuver through the various buttons. This code will trap the key down event for the other keys but not the arrow or tab keys.

 

method-idfrm1CALENDAR_KeyDownfinalprivate.

proceduredivisionusingbyvaluesenderasobjecteastypeSystem.Windows.Forms.KeyEventArgs.

* Immediately return if not a valid action key

IFe::KeyCode = typeKeys::PageUp

ORe::KeyCode = typeKeys::PageDown

ORe::KeyCode = typeKeys::Enter

ORe::KeyCode = typeKeys::Up

ORe::KeyCode = typeKeys::Down

ORe::KeyCode = typeKeys::Left

ORe::KeyCode = typeKeys::Right

ORe::KeyCode = typeKeys::Escape

continue

else

goback.

ife::KeyCode = typeKeys::Up

invokeself::btnUp::PerformClick()

goback

end-if.

ife::KeyCode = typeKeys::Down

invokeself::btnDown::PerformClick()

goback

end-if.

ife::KeyCode = typeKeys::Right

invokeself::btnRight::PerformClick()

goback

end-if.

ife::KeyCode = typeKeys::Left

invokeself::btnLeft::PerformClick()

goback

end-if.

ife::KeyCode = typeKeys::PageUp

invokeself::btnPgUp::PerformClick()

goback

end-if.

ife::KeyCode = typeKeys::PageDown

invokeself::btnPgDn::PerformClick()

goback

end-if.

ife::KeyCode = typeKeys::Enter

invokeself::btnSelect::PerformClick()

goback

end-if.

ife::KeyCode = typeKeys::Escape

invokeself::btnExit::PerformClick()

goback

end-if.

endmethod.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>