指定的元素已经是另一个元素的逻辑子级.首先断开连接. [英] Specified element is already the logical child of another element. Disconnect it first.

查看:116
本文介绍了指定的元素已经是另一个元素的逻辑子级.首先断开连接.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,将控件添加到堆栈面板时出现以下错误消息

Hello I'm getting the following error message when adding controls to a stack panel

如何断开元素的连接?

推荐答案

您好,您可能想将这个问题定向到WPF论坛,而不是这个问题.与可访问性相关的论坛.但是,您能否通过LogicalTreeHelper.GetParent()找到控件的父级,然后调用提供您需要断开连接的控件的Remove()呢?

Hi, you may want to direct this question to a WPF forum, rather than this accessibility-related forum. But can you find the control's parent via LogicalTreeHelper.GetParent() and then call its Remove() supplying the control you need to disconnect?


这篇关于指定的元素已经是另一个元素的逻辑子级.首先断开连接.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆