Like Tree1Likes
  • 1 Post By novacain

Button diseapers behind a picturebox

This is a discussion on Button diseapers behind a picturebox within the Windows Programming forums, part of the Platform Specific Boards category; Hi all, Im making a chess game for class everything is fine tell i move my piece. I use a ...

  1. #1
    Registered User
    Join Date
    Nov 2013
    Posts
    1

    Button diseapers behind a picturebox

    Hi all,
    Im making a chess game for class everything is fine tell i move my piece. I use a button as a chess piece. (it looks cool) and i move it to a tile. Al my titles are picture boxs. when the button move to new location the button disappears under the picture box. is there a way to set the picture box lower then the button or the button higher. im using VB.net 2013 C++ win 32 application.

    thanks for your help

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,853
    You want to set the Z-Order (sometime Z-Index in VB.NET).

    I would set the board to the bottom, rather than all the pieces to the top.

    In WIN32 C++ use SetWindowPos() with HWND_BOTTOM and SWP_NOMOVE | SWP_NOSIZE

    In VB.NET either use SendToBack() on the board control OR use the control collection's SetChildIndex / GetChildIndex to move it to the back (not sure if high is front or low is front so you will have to experiment).
    DeadPlanet likes this.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C# and PictureBox not loading
    By martind1 in forum C# Programming
    Replies: 2
    Last Post: 02-02-2011, 08:47 AM
  2. PictureBox
    By ingenting in forum Windows Programming
    Replies: 2
    Last Post: 06-20-2010, 06:49 AM
  3. Replies: 2
    Last Post: 06-28-2008, 08:30 PM
  4. vc++ picturebox array
    By Crypteasy in forum C++ Programming
    Replies: 3
    Last Post: 01-09-2008, 07:19 PM
  5. picturebox and openfiledialog
    By BraneMxm in forum C# Programming
    Replies: 1
    Last Post: 06-15-2007, 10:32 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21