toolboxitems.add don't work

Discussion in 'ASP .Net Building Controls' started by Sebastien Belleau, Mar 3, 2004.

  1. I want to programmatically add my own custom controls to a
    ToolBoxTab in VS.NET. I can create my own toolbox tab but I cannot add
    item inside. No exception but the items just doesn't appear. there is
    my code:

    Dim DTE As EnvDTE.DTE =
    Microsoft.VisualBasic.Interaction.CreateObject("VisualStudio.DTE.7.1")
    Dim oBoiteOutil As ToolBox =
    DTE.Windows.Item(Constants.vsWindowKindToolbox).Object
    Dim oBOOnglets As ToolBoxTabs
    Dim oBOOnglet As ToolBoxTab
    Dim oBOItem As ToolBoxItem

    oBOOnglets = oBoiteOutil.ToolBoxTabs
    Try
    oBOOnglets.Item("Contrôles MENV").Delete()
    Catch
    End Try
    oBOOnglet = oBOOnglets.Add("Contrôles MENV")
    DTE.ExecuteCommand("view.toolbox", "")

    oBOOnglet.Activate()
    oBOItem = oBOOnglet.ToolBoxItems.Add("New HTML Item", "This is some
    text to add to the HTML file.",
    vsToolBoxItemFormat.vsToolBoxItemFormatHTML)
    oBOItem = oBOOnglet.ToolBoxItems.Add("Outil Menv",
    System.Environment.SpecialFolder.CommonProgramFiles &
    "\ServicesCommunsDotNetv1_0_0\Environnement.ServicesCommuns.Web.dll",
    vsToolBoxItemFormat.vsToolBoxItemFormatText)
    oBOItem = oBOOnglet.ToolBoxItems.Add("toto", "toto",
    vsToolBoxItemFormat.vsToolBoxItemFormatText)
     
    Sebastien Belleau, Mar 3, 2004
    #1
    1. Advertisements

  2. Sebastien,

    i'm in front of the same problem. Did you get out of it ?

    regards,

    d
     
    Damien DORISON, Mar 5, 2004
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.