【发布时间】:2013-11-29 12:52:17
【问题描述】:
我需要将我的 WPF USerControl 插入到 Windows.Form 中。这是我的控制:
<UserControl x:Class="WpfControlLibrary1.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="Transparent">
<InkCanvas x:Name="Ink" Background="Transparent" />
</UserControl>
为了承载这个控件,我使用ElementHost 对象作为我表单的唯一一个控件。我需要有可能做到以下几点:当我将表单的不透明度设置为0时,为了使其不可见,我需要继续拥有我@的所有Children和Strokes的不透明度987654327@ 到 1(这样我可以看到它们)。
我尝试使用TransparencyKey 属性,但它似乎不适用于ElementHost。我该如何解决这个问题,如何在 Form 和 UserControl 之间设置不同的不透明度?
【问题讨论】:
标签: c# wpf winforms transparency elementhost