Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IsCancelButton... or isn't?

Status
Not open for further replies.

IlyaRabyy

Programmer
Nov 9, 2010
568
US
Colleagues,
Unless I misinterpret the meaning of this property in subject, once it's set to True, it fires this button's Click event when the User hits Esc key on keyboard - right?
So, besides having hotkey on my Exit button on form, I want to give the User possibility to just hit Esc key (instead of Alt+X, let alone Tab-ing to the Exit button through all the form).
So, I checked Help - there's IsCancel property in the System.Forms.Button class, which, according to
"When you set the IsCancel property of a button to true, you create a Button that is ... then activated when a user presses the ESC key"... which is exactly what I need.

But this property in not in the button's property sheet in VS 2019 VB IDE! [ponder]

2022_09_23_ButtonIsCancelPropertyInHelp_szy2x3.jpg


(FYI, in VFP this property of a Command Button is clearly visible in the Properties sheet! Can't recall if it was so in VB6...)

What am I missing or misunderstand?

Please advise!
TIA!
(Just in case: my WS is Windows 10, and it's MS VS 2019.)

Regards,

Ilya
 
C heck yopur project type - believe property only exposed in WPF projects, not WFA
 
There's no WFP, only WFA type in the list:

2022_09_27_10_16_ProjectTypes_zkglfl.jpg


Regards,

Ilya
 
#Um - you pretty much can't just swich at the click of an option from WFA to WPF, they are very different beasts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top