更改 wpf 应用程序中托管 winForms 元素的可见性

发布于 2024-07-12 04:17:23 字数 233 浏览 9 评论 0原文

我有 ReportViewer winForms 控件,用于在通过 WindowsFormsIntegration 托管的 WPF 应用程序中显示 Microsoft 报表。 当我的 textBlock 的 MouseDown 事件触发时,我希望它的可见性从 0 淡出到 100,就像窗口中的其他一些元素一样。 事实并非如此,所以我想知道对于所有托管控件还是这个特定控件都是一样的,如何解决?

问候,

伊万

I have ReportViewer winForms control for showing Microsoft Reports in my WPF application hosted over WindowsFormsIntegration.
When the MouseDown event of my textBlock triggers, I would like it to fade lets say from 0 to 100 visability, like some other elements in my Window. It doesn't, so I was wondering is it the same for all hosted controls or this one specific and how can it be solved?

Regards,

Ivan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一刻暧昧 2024-07-19 04:17:23

WindowsFormsHost 支持透明度。 但某些 WinForms 控件则不然。

请参阅Windows Presentation Foundation 和 Windows 窗体互操作中的支持方案一文: MSDN。 特别是“行为”表中的第一行:

某些 Windows 窗体控件没有
支持透明度。 例如,
TextBox 和 ComboBox 控件不会
由 WPF 托管时保持透明。

The WindowsFormsHost supports Transparency. But some WinForms Controls do not.

See the Supported Scenarios in Windows Presentation Foundation and Windows Forms Interoperation article on MSDN. Especially the first row in the "Behaviour" table:

Some Windows Forms controls do not
support transparency. For example, the
TextBox and ComboBox controls will not
be transparent when hosted by WPF.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文