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. Zorder

Zorder

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
4 Posts 3 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.
  • J Offline
    J Offline
    JekYu
    wrote on last edited by
    #1

    Hi just wanna ask how do you manipulate the "Z-order" in visual C++??? How do you put one picture box on top or at the back of another picture box... Thanks......

    C 1 Reply Last reply
    0
    • J JekYu

      Hi just wanna ask how do you manipulate the "Z-order" in visual C++??? How do you put one picture box on top or at the back of another picture box... Thanks......

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      SetWindowPos is generally how you set the Z-order of a window. Given that controls are also a CWnd, I'd try that first. Christian As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet. Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.

      J 1 Reply Last reply
      0
      • C Christian Graus

        SetWindowPos is generally how you set the Z-order of a window. Given that controls are also a CWnd, I'd try that first. Christian As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet. Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.

        J Offline
        J Offline
        JekYu
        wrote on last edited by
        #3

        hi.. m_s1 and m_s2 are CSTATIC but seems like it's not working... void CTesting3_bmpView::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default CFormView::OnLButtonDown(nFlags, point); if (flip == TRUE) { flip = FALSE; m_s1.SetWindowPos (&wndTop, 1, 1, 100, 100, SWP_NOSIZE | SWP_NOMOVE); //m_s1.BringWindowToTop (); } else { m_s2.SetWindowPos (&wndTop, 1, 1, 100, 100, SWP_NOSIZE | SWP_NOMOVE); //m_s1.BringWindowToTop (); flip = TRUE; } UpdateData(FALSE); Invalidate(); }

        L 1 Reply Last reply
        0
        • J JekYu

          hi.. m_s1 and m_s2 are CSTATIC but seems like it's not working... void CTesting3_bmpView::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default CFormView::OnLButtonDown(nFlags, point); if (flip == TRUE) { flip = FALSE; m_s1.SetWindowPos (&wndTop, 1, 1, 100, 100, SWP_NOSIZE | SWP_NOMOVE); //m_s1.BringWindowToTop (); } else { m_s2.SetWindowPos (&wndTop, 1, 1, 100, 100, SWP_NOSIZE | SWP_NOMOVE); //m_s1.BringWindowToTop (); flip = TRUE; } UpdateData(FALSE); Invalidate(); }

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          are you trying to show between two button at the same position to do two different task ? if so, i sugguest you not to use z-order but just change the object text of the button ( or CStatic ) by CWnd::SetWindowText(LPCTSTR lpszString) and if they are executable, set a flag ( i think you already have, which is "flip".. ) and in OnClick of that object, check the flag and do different task.. but as you said they are just static.. i guess you only wanna display different text SetWindowText can do what you need

          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