Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 发送到运行时创建的返回对象_C#_Wpf_Z Index - Fatal编程技术网

C# 发送到运行时创建的返回对象

C# 发送到运行时创建的返回对象,c#,wpf,z-index,C#,Wpf,Z Index,我有一个页面,在这个页面中我有一个图像,在运行时我添加了3个按钮,但这些按钮出现在图像的前面。我怎样才能把这些按钮发回去。我使用Panel.SetZindex,但不起作用。谢谢。将按钮z-index属性设置为尽可能低的数字,然后在运行时添加。您是否也使用了面板.SetZindex进行图像控制?我想你会把它用在按钮上,而不是图像上,这就是为什么按钮仍然出现在图像控件的前面 您应该将按钮的z-索引设置为最小可能值,将图像的z-索引设置为最大可能值,以便图像位于前面 使用以下代码: Panel.Set

我有一个页面,在这个页面中我有一个图像,在运行时我添加了3个按钮,但这些按钮出现在图像的前面。我怎样才能把这些按钮发回去。我使用Panel.SetZindex,但不起作用。谢谢。

将按钮z-index属性设置为尽可能低的数字,然后在运行时添加。

您是否也使用了
面板.SetZindex
进行图像控制?我想你会把它用在按钮上,而不是图像上,这就是为什么按钮仍然出现在图像控件的前面

您应该将按钮的z-索引设置为最小可能值,将图像的z-索引设置为最大可能值,以便图像位于前面

使用以下代码:

Panel.SetZindex(button1,0);
Panel.SetZindex(button2,1);
Panel.SetZindex(button3,2);

Panel.SetZindex(image,3);

请显示您的代码/XAML。您是否尝试增加图像的Panel.SetZindex?