Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding click/double-click events to static group box controls
    primarykey
    data
    text
    <p>Having realised my own reasons were way too dubious, I've now gone about this a different way. But I'm still curious...</p> <p>For reasons of nostalgia, familiarity and laziness, I'm coding a UI with MFC. For dubious reasons (as if those were not enough), I wanted to add a (double-)click event to a group box. Naturally, the group box contains things - in fact, it contains another static item, to which I can successfully add a (double-)click event handler.</p> <p>Is there any reason I cannot get an event handler to work for clicks on my group box the same way I can do that for the simple text static item? No amount of clicking on, in or near the control fires the event.</p> <p>Note - I've read through <a href="http://www.codeproject.com/KB/static/staticctrl_tut.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/static/staticctrl_tut.aspx</a> and tried responding to both ON_STN_... events and ON_BN_... messages, setting the notify style (BS_NOTIFY appears in the rc file)... and still I'm missing something - what is it? Is it even possible? Most of what I've googled suggests it is... but without clear answers for C++/MFC.</p> <p>Since first posting this question, I've found reference to a WM_NCHITTEST message, and hints that you have to create a handler for this message to override the group box default behaviour of responding with HT_TRANSPARENT... despite having its transparent property in ClassWizard set to false. Hmmm. Can anyone confirm that this is indeed the key?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload