Results 1 to 5 of 5

Thread: ZOrder and GUI

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2009
    Posts
    57

    ZOrder and GUI

    Hey everyone, i'm new to vb.net and need a little knowledge here...

    in vb6 i was able to create picture boxes and do pic.Zorder = 0 and it would bring it to the front.

    in .net i'm using the panel control and doing .BringToFront and i also tried the panel.Parent.Controls.SetChildIndex(panel, 0)... nothing seems to work..

    is there another control i should use for this to work? thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: ZOrder and GUI

    BringToFront will bring a control to the front of the z-order within its parent. If it's not doing what you expect then either you're expecting it to do something else or something is broken, either in your project or on your system.

    Try creating a new project with just two controls and see if BringToFront works there. If it doesn't then your system is broken. If it does then either your other project is broken or you're expecting something other than what BringToFront does.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2009
    Posts
    57

    Re: ZOrder and GUI

    yeah is vb10 the most reliable? so far it doesnt look that way... 2008 maybe? or 2005? let me know what you guys think

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: ZOrder and GUI

    There's no "reliability" issue.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: ZOrder and GUI

    it's most likely the container issue. Some container controls can't have their z-order moved.

    in addition, panel.parent is referencing the form or control the panel is in, and has nothing to do with any controls the panel contains.
    does panel.controls(1).bringtofront behave the way you wish?
    Last edited by Lord Orwell; May 29th, 2011 at 09:59 PM.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width