You are here: Blog
Menu
Categories
.NET
DotNetNuke
ECO
General
UI
Archive
August, 2014 (1)
September, 2013 (1)
February, 2010 (2)
October, 2008 (2)
September, 2008 (1)
July, 2008 (2)
June, 2008 (1)
April, 2008 (3)
February, 2008 (1)
December, 2007 (1)
October, 2007 (2)
June, 2007 (2)
March, 2007 (1)
January, 2007 (1)
December, 2006 (3)
Search
Software development matters
Jul 11

Written by: Oleg Zhukov
7/11/2008 1:51 AM

In WinForms controls' overlapping (z-order, in other words) is adjusted easily by calling Control.BringToFront() and Control.SendToBack() methods. In Silverlight 2.0 the way to change z-order is not as straightforward although quite simple too.

First of all the default overlapping is controlled by the order in which controls appear in XAML: each subsequent element is placed on the top of the previous ones, like in the example below:

 

For changing the z-order in the XAML markup the Canvas.ZIndex attached property should be applied to elements. Higher property values place the control on the top of others: 

The same effect can be achieved through the C# code by using Canvas.SetZIndex(...) static method:

Tags:

Copyright 2007-2016 by Oleg Zhukov Terms Of UsePrivacy Statement