在VSX项目中向窗体设计器添加控件

在VSX项目中向窗体设计器添加控件

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

问题描述

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

解决方案

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? 

解决方案


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

08-06 06:30