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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. OnGridEndEdit and MessageBox

OnGridEndEdit and MessageBox

Scheduled Pinned Locked Moved C / C++ / MFC
csshelpquestion
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.
  • A Offline
    A Offline
    adonisv
    wrote on last edited by
    #1

    I'm throwing up a message box inside the OnGridEndEdit function of a CGridCtrl object. I want to inform the user that a duplicate name has been entered and a unique one must be supplied. However, after the message box is clicked on, the cursor highlights cells in the grid control and its a wierd side effect. Any suggestions? Here is the code: void RDialogForEditingCanalObjects::OnGridEndEdit(NMHDR *pNotifyStruct,LRESULT* pResult) { bool bAcceptChange = false; CGridCellBase* pRow = NULL; NM_GRIDVIEW* pItem = (NM_GRIDVIEW*) pNotifyStruct; if (this->m_eCanalObjectType != CO_SSFC) { if (pItem->iRow == 1 && pItem->iColumn == 1) { pRow = this->m_PrimaryGrid.GetCell(pItem->iRow,pItem->iColumn); if (pRow) { switch(this->m_pCanMan->IsNameUnique(pRow->GetText())) { case 0: Beep(999,189); Beep(999,189); MessageBox("Please enter a unique name for this object", "Duplicate Naming Error!",MB_OK); bAcceptChange = FALSE; break; case 1: bAcceptChange = TRUE; break; } } } } }

    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