Click here to Skip to main content
15,887,411 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a usercontrol which is a VSIX tool window (Visual Studio Extension). I want to get the height and width of the tool window when a button is clicked.

This has proved elusive so far. I tried ActualWidth, ActualHeight, Height, Width, Render size tried doing a Mesaure(double.infinity,double.infinity) and then doing above. I also tried calling UpdateLayout and doing the measurement. The value never changes.

What I have tried:

There are other classes like below. The class I tried the above steps is the class that is derived from UserControl which is used on the Form. The class below are other classes that are typical in a userControl and autocreated when i create a VSIX solution. I am not an expert in the relationships.
<pre>
public sealed class ToolWindow1Package : Package
{

}
public class ToolWindow1 : ToolWindowPane
{
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900