मेरे पास एक WPF नियंत्रण है जिसे मैं WinForms एप्लिकेशन पर ओवरले करना चाहता हूं।सी # विनफॉर्म नियंत्रण पर डब्ल्यूपीएफ पारदर्शिता
<UserControl x:Class="LightBoxTest.LightBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="300" Width="300" Background="Transparent">
<Grid Name="dialogHolder" Background="Transparent" Opacity="1">
<Rectangle Name="rectangle1" Stroke="White" Fill="Black" RadiusX="10" RadiusY="10" Opacity="0.5" />
<StackPanel Name="stackPanel1" Background="Transparent" Height="300" VerticalAlignment="Top">
<Rectangle Name="spacer" Opacity="0" Stroke="Gray" Fill="White" RadiusX="10" RadiusY="10" Height="100" Width="300" />
<Grid Height="100" Name="contentHolder" Width="250">
<Rectangle Name="dialog" Stroke="Gray" Fill="White" RadiusX="10" RadiusY="10" Height="100" Width="250" />
</Grid>
</StackPanel>
</Grid>
</UserControl>
मुसीबत है कि WinForm प्रपत्र पर नियंत्रण प्रदान नहीं करते और WPF सिर्फ स्क्रीन पर उन्हें obliterates: तो मैं कर्तव्यनिष्ठा एक तत्व होस्ट निम्न WPF वस्तु दिखा सकते हैं बनाया है।
तत्व मेजबान की तरह बनाई गई है:
dialogHost = new ElementHost();
dialogHost.Child = dialog;
dialogHost.BackColorTransparent = true;
dialogHost.BringToFront();
dialogHost.Show();
वहाँ कुछ है मैं क्या करना चाहिए और मैं नहीं?
क्या Winforms पर पारदर्शी WPF नियंत्रण दिखाने के बारे में ज्ञात समस्याएं हैं?
कोई भी कलात्मक जो मदद कर सकती है?
ध्यान दें: यह सवाल this question