title: .Net windows forms custom layout engine
body: <p>I am trying to write a card game, where a player is able to stack cards. E.g. Ace, Two, Three.</p>
  
  <p>I would like to visualize a stack of cards, where the Ace card is partially covered by the Two card, and the Two card is partially covered by the Three card. The Three card is completely visible.</p>
  
  <p>Easy, I thought. I make a user control where I add my cards: Controls.Add(ace); Controls.Add(two); etc.</p>
  
  <p>Then I need something that is able to lay-out my Controls, so I wrote my custom LayoutEngine (derives from LayoutEngine). My first test does nothing more then shift the control 50 pixels. </p>
  
  <p>After running the solution I noticed that the Z-ordering was wrong. Instead of the Three card being on top, the Ace card was on top looking like this:</p>
  
  <p>Ace Card > Two card > Three card where:
  Ace Card is on top
  Two Card is under the Ace Card
  Three Card is under the Two Card.</p>
  
  <p>So I started looking for a way to change the Z order in WinForms and found out that it is simply "not available". Like.. Huh?! </p>
  
  <p>The alternative (provided by MS) is that the Z order can be altered, by setting the ChildIndex for the Controls. Jikes, that means that poking around in a list, change the behaviour of my application. Way to go MS...</p>
  
  <p>Anyway, I tried all kind of things, but it seems impossible to write a layout engine that does the trick.</p>
  
  <p>I've google-d all day, and found nothing useful. I am no GUI expert, so I run stuck on this lame issue. Who can help me out?</p>
  
  <p>Much appreciated!</p>
  
  <p>Bas </p>