Windows.CreateToolWindow Method
Assembly: EnvDTE (in envdte.dll)
Window CreateToolWindow ( [InAttribute] AddIn AddInInst, [InAttribute] string ProgID, [InAttribute] string Caption, [InAttribute] string GuidPosition, [InAttribute] out Object DocObj )
Window CreateToolWindow ( /** @attribute InAttribute() */ AddIn AddInInst, /** @attribute InAttribute() */ String ProgID, /** @attribute InAttribute() */ String Caption, /** @attribute InAttribute() */ String GuidPosition, /** @attribute InAttribute() */ /** @attribute OutAttribute() */ /** @ref */ Object DocObj )
Parameters
- AddInInst
Required. An AddIn object whose lifetime determines the lifetime of the tool window.
- ProgID
Required. The programmatic ID of the Document object or ActiveX control.
- Caption
Required. The caption for the new tool window.
- GuidPosition
Required. A unique identifier for the new tool window, which can be used as an index to Item.
- DocObj
Required. The Document object or control to be hosted in the tool window.
Return Value
A Window object.If you attempt to set any of the visibility states of the new tool window — such as height, width, or position — before the tool window is visible, you get an error. Therefore, make sure that the window is visible before attempting to set any such properties.
For an example of how to use this method, see the ToolWindow sample on the Visual Studio Automation Samples Web page: http://msdn.microsoft.com/vstudio/downloads/samples/automation.asp. For information about creating ActiveX controls, see Creating an MFC ActiveX Control.
Previous versions of Visual Studio did not have the ability to create tool windows using .NET user controls. Instead, an unsupported ActiveX control was available which would enable this functionality. Versions of Visual Studio after VS 2005 do support hosting .NET User Controls registered as ActiveX controls, however it is preferrable that the method Windows2.CreateToolWindow2 is used to host the control directly rather than going through an ActiveX interop mechanism.
- 6/15/2006
- Craig Skibo - MSFT
- 6/7/2006
- Craig Skibo - MSFT
- 6/7/2006
- Craig Skibo - MSFT