本文介绍了工具窗口未停靠-VSPackage- vs 2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在VS 2008中开发VSPackage.

i am developing a VSPackage in VS 2008.

我已经在该工具窗口中创建了一个工具窗口和几个选项卡.

I have created a toolwindow and few tabs in that tool window.

我已经使用ProvideToolWindowAttribute提供工具窗口信息.

I have used the ProvideToolWindowAttribute to provide tool window information.

[ ProvideToolWindow ( 类型 ( ;颜色:#2b91af"> MyToolWindow ), 样式= VsDockStyle .Tabbed,Orientation = ToolWindowOrientation .底部,窗口= " 3ae79031-e1bc-11d0- 8f78-00a0c9110057" )]

[ProvideToolWindow(typeof(MyToolWindow), Style = VsDockStyle.Tabbed, Orientation =ToolWindowOrientation.Bottom, Window ="3ae79031-e1bc-11d0-8f78-00a0c9110057")]

我希望工具窗口停靠在出现错误列表/输出窗口的位置.如果还有其他打开的窗口以及打包工具"窗口,我希望它们与创建的工具窗口一起显示.

使用上述属性,我无法将工具窗口停靠到I​​DE.安装软件包后,它总是看起来是浮动的.

With the above attribute i am not able to dock the tool window to the IDE. it always appears to be floating after the package installation.

我在Initialize函数中使用了以下内容:

I have used the following in the Initialize function:

windowFrame =( IVsWindowFrame )RWindowPane.Frame;

windowFrame = (IVsWindowFrame)RWindowPane.Frame;

windowFrame.SetProperty((( int ) __ VSFPROPID .VSFPROPID_Type, VSFRAMEMODE .VSFM_Dock);

windowFrame.SetProperty((int)__VSFPROPID.VSFPROPID_Type,VSFRAMEMODE.VSFM_Dock);

但没有用.

有人可以帮我解决这个问题吗?

 

谢谢,

Nayna

 

 

推荐答案

您可以设置Window.IsFloating属性设置为false.请参阅以下代码:

You can set the Window.IsFloating Property to false. See following code:

if (this.win == null)
  this.CreateToolWindow();

_applicationObject.MainWindow.LinkedWindows.Add(this.win);
this.win.Linkable = false;
this.win.IsFloating = false;

有关更多信息,请参见以下主题:

For more information, please see following thread:

http://social.msdn.microsoft.com /Forums/en/vsx/thread/93e90d60-4cd0-4ef8-beac-d91b9122b387

最好的问候,

Nancy


这篇关于工具窗口未停靠-VSPackage- vs 2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 09:05