Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. message BN_CLICKED for button in flexgrid

message BN_CLICKED for button in flexgrid

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zeus_master
    wrote on last edited by
    #1

    I create a button in a flexgrid, and want to get the BN_CLICKED message of the button. though I add the ON_BN_CLICKED in MESSAGE_MAP,still can't run into onbutton1(). is it the only way that Override OnCommand()? .h class class CProjDlg : public CDialog { ... public: CMSFlexGrid m_FlexGrid; private: CButton m_btn; .... afx_msg void OnButton1(); } #define IDC_MYBUTTON 1999 .cpp creat button BEGIN_MESSAGE_MAP(CProg5Dlg, CDialog) //{{AFX_MSG_MAP(CProg5Dlg) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_BN_CLICKED(IDC_BUTTON1, OnButton1) //}}AFX_MSG_MAP END_MESSAGE_MAP() create the button from the flexgrid void CProg5Dlg::InitControls() { .... m_btn.Create("btn",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(100,40,140,120),&m_FlexGrid,1999); .. } void CProjDlg::OnButton1() { // TODO: Add your control notification handler code here AfxMessageBox("button click"); }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups