1

I would like to open the Winform's CustomTaskPane in Excel at maximum size when it is first opened. How to maximize the custome taskpane?

Let's say the TaskPane is docked to the left of the Excel screen. According to MDSN

The maximum width is **approximately** half the width of the screen
Kenny
  • 1,902
  • 6
  • 32
  • 61
  • Are you asking how to get current window size of Excel? I assume once you have that setting the width is trivial. – Charlie Jun 19 '15 at 13:39
  • No I am asking how to maximize the CustomTaskPane inside Excel. I Because it is "approximately" half I wonder if there is another way to maximize it without approximation of half Excel size – Kenny Jun 19 '15 at 14:14
  • It looks to me like it has to be "floating" vs docked to get it bigger than half the screen. I assume that's a hard limit imposed by Excel. I would recommend a full form in a separate window if it needs to be that large - are you familiar with Application level Add-in forms? – Charlie Jun 19 '15 at 14:26
  • Do you mean Form and its Form.ShowDialog() ? My UserControl needs to be a CustomTaskPane, added into CustomTaskPanes colelction. Side question : If I want to set it to the maximum size possible ("approximately" half of the screen) is there any way to set it programmatically instead of setting to "half of the scree", which by itself is an approximation ? – Kenny Jun 19 '15 at 14:40
  • This is what I would use for your form https://msdn.microsoft.com/en-us/library/ms268878.aspx and yes you can get the Excel size using something like this http://stackoverflow.com/questions/18135634/how-to-center-a-wpf-window-in-a-excel-vsto-addin – Charlie Jun 19 '15 at 20:11

0 Answers0