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. how to show a button after move it?

how to show a button after move it?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 Posts 2 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.
  • T Offline
    T Offline
    tataxin
    wrote on last edited by
    #1

    I have a button on a list, something like whenever you select a row, move the button to that row. So I implement this in OnLvnItemchangedList event:

    void CMyDlg::OnLvnItemchangedList(NMHDR *pNMHDR, LRESULT *pResult)
    {
    ...
    // canculate the rec by seleted row
    CRect rec;
    ...

    // move button
    m_myBtn.MoveWindow(rec);
    m_myBtn.ShowWindow(SW_SHOW);
    m_myBtn.BringWindowToTop();

    InvalidateRect(rec);
    m_myBtn.RedrawWindow();

    }

    It works, but I cannot see the button. :confused::confused: If the mouse moves over the button, it shows then I can see it. I don't know why, maybe there's something wrong in my last two source code rows. Can anyone explain how to solve this?? Thank you in advance !!

    K 1 Reply Last reply
    0
    • T tataxin

      I have a button on a list, something like whenever you select a row, move the button to that row. So I implement this in OnLvnItemchangedList event:

      void CMyDlg::OnLvnItemchangedList(NMHDR *pNMHDR, LRESULT *pResult)
      {
      ...
      // canculate the rec by seleted row
      CRect rec;
      ...

      // move button
      m_myBtn.MoveWindow(rec);
      m_myBtn.ShowWindow(SW_SHOW);
      m_myBtn.BringWindowToTop();

      InvalidateRect(rec);
      m_myBtn.RedrawWindow();

      }

      It works, but I cannot see the button. :confused::confused: If the mouse moves over the button, it shows then I can see it. I don't know why, maybe there's something wrong in my last two source code rows. Can anyone explain how to solve this?? Thank you in advance !!

      K Offline
      K Offline
      KarstenK
      wrote on last edited by
      #2

      Check the coordinates of the button and you will see why you dont see it :-O

      Greetings from Germany

      T 1 Reply Last reply
      0
      • K KarstenK

        Check the coordinates of the button and you will see why you dont see it :-O

        Greetings from Germany

        T Offline
        T Offline
        tataxin
        wrote on last edited by
        #3

        hi KarstendK, I don't understand what you mean. When I move the mouse over the button, it shows.

        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