请知道的给个提示,我死活也没找出来  。因为不想去读 代码来识别。想直接使用 接口提供的 对象来操纵。

解决方案 »

  1.   

    http://www.cnblogs.com/dudu/archive/2007/02/06/642229.html
    http://www.cnblogs.com/dudu/archive/2007/02/01/635746.html
      

  2.   

    http://www.chenjiliang.com/Article/View.aspx?ArticleID=513&TypeID=73
      

  3.   

    public void AddControlsDelegate(DTE2 dte)
    {
        Project prj = (Project)((Array)dte.ActiveSolutionProjects).GetValue(0);
        ProjectItem item = prj.ProjectItems.Item("Form1.cs") as ProjectItem;
        Window itemDesigner = item.Open(Constants.vsViewKindDesigner);
        itemDesigner.Activate();
        IDesignerHost host = itemDesigner.Object as IDesignerHost;    IContainer ic = host.Container;    (ic.Components["textBox1"] as System.Windows.Forms.TextBox).Size = new Size(200, 21);    foreach (IComponent cp in ic.Components)
        {
            if (cp is System.Windows.Forms.Button)
            {
                (cp as System.Windows.Forms.Button).Text = "aa";
            }
        }
    }