在VSX项目中向窗体设计器添加控件 [英] Adding Controls to the form designer in a VSX project

查看:79
本文介绍了在VSX项目中向窗体设计器添加控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VB.Net和Visual Studio 2015,对VSX等是一个新手。我创建了一个带有自定义工具窗口的VsPackage,它生成一个标准控件列表,添加到当前打开的表单设计器中。我已经尝试使用IDesignerHost.CreateComponent
例程以及Container.add例程将控件添加到表单。在每种情况下,设计视图中都没有显示,但是,如果我查看form.designer.vb代码,我会看到我的所有控件都已添加为好友,所有属性都在InitializeComponent例程中正确设置
。但是,此例程中缺少代码,包括例程开头的components = New System.ComponentModel.Container和通常在结尾处找到的Me.controls.add例程。我觉得我非常接近但却错过了一些东西。有什么建议吗? 

解决方案

请参阅:


HOWTO:从Visual中添加控件到Windows窗体Studio加载项

http://www.visualstudioextensibility.com/articles/add-ins /


I am using VB.Net and Visual Studio 2015 and am very new to VSX, etc.. I have created a VsPackage with a Custom Tool Window which generates a list of standard controls to be added to the currently open form designer. I have tried using the IDesignerHost.CreateComponent routine as well as the Container.add routines to add the controls to the form. In each case, nothing shows in the design view but, if I look at the form.designer.vb code, I see all of my controls have been added as friend with all of the properties set properly in the InitializeComponent routine. There is, however, code missing from this routine including the components = New System.ComponentModel.Container at the beginning of the routine and the Me.controls.add routines normally found at the end. I feel like I am very close but missing something. Any suggestions? 

解决方案

See:

HOWTO: Add a control to a Windows form from a Visual Studio add-in
http://www.visualstudioextensibility.com/articles/add-ins/


这篇关于在VSX项目中向窗体设计器添加控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆