toolboxitems.add don't work

  • Thread starter Sebastien Belleau
  • Start date
S

Sebastien Belleau

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)
 
D

Damien DORISON

Sebastien,

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

regards,

d
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top