How to let Enter-key-press message goes to ActiveX control on dialog - Programmer

This is a discussion on How to let Enter-key-press message goes to ActiveX control on dialog - Programmer ; I have next problem, I have dialog and Grid (ActiveX control) on it. But when I edit some cell and then press Enter, dialog closes. To not do this, I redefine CDialog::OnOK() in my dialog-class, and make this function empty. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to let Enter-key-press message goes to ActiveX control on dialog

  1. How to let Enter-key-press message goes to ActiveX control on dialog

    I have next problem,

    I have dialog and Grid (ActiveX control) on it. But when I edit
    some cell and then press Enter, dialog closes.
    To not do this, I redefine CDialog::OnOK() in my dialog-class,
    and make this function empty. So, when I press Enter this time,
    nothing (!) happens. Neither dialog closes nor Grid act like
    he must.

    What I have to do that Grig will be react on Enter key press (like he
    react correct on other keys, like F2)

    Thank you,
    sorry for my English
    Yura

  2. Re: How to let Enter-key-press message goes to ActiveX control on dialog

    You can redefine CDialog::PretranslateMessage (I think) to catch keyborad
    strikes and redirect events to your ActiveX.

    "Yuri W." a écrit dans le message de
    news:b710733e.0409070422.8c0416e@posting.google.co m...
    > I have next problem,
    >
    > I have dialog and Grid (ActiveX control) on it. But when I edit
    > some cell and then press Enter, dialog closes.
    > To not do this, I redefine CDialog::OnOK() in my dialog-class,
    > and make this function empty. So, when I press Enter this time,
    > nothing (!) happens. Neither dialog closes nor Grid act like
    > he must.
    >
    > What I have to do that Grig will be react on Enter key press (like he
    > react correct on other keys, like F2)
    >
    > Thank you,
    > sorry for my English
    > Yura




+ Reply to Thread