c#代码中的错误功能 [英] Error function in c# code
本文介绍了c#代码中的错误功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在C#代码中有错误。
I have a ERROR in C# code .
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Navigation;
using System.Windows.Input;
using System.Media;
private VideoViewerWPF _videoViewerWpf ;
private void SetVideoViwer()
{
_videoViewerWpf = new VideoViewerWPF
{
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Stretch,
Background = Brushes.Black
};
CameraBox.Children.Add(_videoViewerWpf);
_videoViewerWpf.SetImageProvider(_provider);
}
我希望你能帮帮我。
这些错误:
I hope you can help me .
these ERROR :
PictureBox.Children.Add(_videoViewerWpf); 'System.Windows.Forms.PictureBox' does not contain a definition for 'Children' and no extension method 'Children' accepting a first argument of type 'System.Windows.Forms.PictureBox' could be found (are you missing a using directive or an assembly reference?)
HorizontalAlignment = HorizontalAlignment.Stretch, horizontalalignment' is an ambiguous reference between 'system.windows.forms.horizontalalignment'
Background = Brushes.Black Background = Brushes.Black cannot implicitly convert type 'system.drawing.brush' to 'system.windows.media.brush'
我尝试了什么:
我试图解决这个错误,但我不能在Children.Add(_videoViewerWpf)中出现错误。 Background = Brushes.Black AND HorizontalAlignment = HorizontalAlignment.Stretch,
What I have tried:
I tried to solve this ERROR but I can't I have ERROR in Children.Add(_videoViewerWpf); Background = Brushes.Black AND HorizontalAlignment = HorizontalAlignment.Stretch,
推荐答案
错误消息是清楚的,请查看图片盒类(System.Windows.Forms) [ ^ ] 。没有儿童
属性。
The error message is queite clear, look at the documentation for PictureBox Class (System.Windows.Forms)[^]. There is no Children
property.
这篇关于c#代码中的错误功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文