需要帮助 - WPF 中的 IWindowsFormsEditorService?或者可能是我的问题的另一种替代解决方案
我已采用以下代码并将其扩展为我的代码:
http://www.codeproject .com/KB/vb/PropertyGridEx.aspx
我的代码是用 WPF 编写的程序,而示例位于 Windows 窗体应用程序中
我的代码-
我的问题-
“IWindowsFormsEditorService”仅适用于由 Windows 窗体应用程序创建的 UserControl 窗口,因此以下行:
wfes.DropDownControl(ucUseValue);
显示以下错误:
错误 1 与“System.Windows.Forms.Design.IWindowsFormsEditorService.DropDownControl(System.Windows.Forms.Control)”匹配的最佳重载方法具有一些无效参数
错误 2 参数 1:无法从“Visual_Command_Line.UserControls.ArgumentEditor.UseValueArg”转换为“System.Windows.Forms.Control”
所以,我想到了两种解决方案 - 告诉我其中之一是否可行:
WPF 中是否有“IWindowsFormsEditorService”的替代方案?
有没有可能的方法将我的 UserControl(“UseValueArg”)转换为 System.Windows.Forms.UserControl 类型的 UserControl?
- 一个 System.Windows.Forms.Control 类型而不是 WPF 类型的 UserControl(我已经尝试过并且它有效,尽管在 WPF 中使用 Windows 窗体应用程序似乎很愚蠢)
提前感谢, 喧闹声
I've taken the following code and extended it to my code:
http://www.codeproject.com/KB/vb/PropertyGridEx.aspx
My code is a program written in WPF while the example is in Windows Forms Application
My code-
My problem-
the "IWindowsFormsEditorService" is only for UserControl windows that made by Windows Forms Application so the following row:
wfes.DropDownControl(ucUseValue);
Shows the following errors:
Error 1 The best overloaded method match for 'System.Windows.Forms.Design.IWindowsFormsEditorService.DropDownControl(System.Windows.Forms.Control)' has some invalid arguments
Error 2 Argument 1: cannot convert from 'Visual_Command_Line.UserControls.ArgumentEditor.UseValueArg' to 'System.Windows.Forms.Control'
So, i thought of two Solutions - tell me if one of them is possible:
Is there any alternative to "IWindowsFormsEditorService" in WPF?
Is there any possible way to convert my UserControl which is "UseValueArg" to a System.Windows.Forms.UserControl type of UserControl?
Creating a UserControl that is of type System.Windows.Forms.Control and not of WPF (something which I already tried and it works, though it's seems stupid to have Windows Forms Application in a WPF)
Thanks in advanced,
Din
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然我的回答在主题中有点“偏离”,但您可能想尝试: http://wpg.codeplex.com /
Though my answer is a little 'off' in the topic, you might want to try: http://wpg.codeplex.com/