I wrote a dockpaneplugin and its panel gets truncated if it was docked when navisworks started:
- when I first lauch the command the panel is displayed and everything works fine
- I can dock and undock it with anyother window, it works fine
- if I close the application with the panel docked, and re open Naviswork, then the panel is truncated of a couple centimeters, with no (sufficient) scroll bar to see it completly
I set all control on the panel to either dock or anchored to sides, the form is on Autosize, the plugin attributes are as follow:
<DockPanePlugin(310, 225, FixedSize:=False, AutoScroll:=True, MinimumWidth:=310, MinimumHeight:=225)>
What am I missing?
I used this line with the demo of my dock pane plugin, opened Navisworks and docked the window. And I closed Navisworks , reopened it. The dock pane window is same. not truncated.
I also changed the size of the dock pane windows (assume the controls are anchored) intentionally, closed Navisworks and opened it. All works well.
Could you share a small demo project to show the problem?
In addition, I am testing with 2013.
Here you go;
I am running Navis manage 2013 too.
I isolated only the piece of code you need to reproduce the issue; the panel gets truncated a bit less than the other one I have but still loses some space on the right.
so to reproduce:
- unzip docktest_dllfornavis and put it in Navis plugin folder
- start Navis, goto Addin, start "Display Name"
- see how the space between the comboboxes and the form borders is equal on both sides
- dock it, restart navis
-> the panel shold be truncated to the right
PS: I change the extension of the file from .rar to .bmp otherwise the forum wouldn't let me upload it; you need to change it back. Let me know if you'd rather have me paste the code in the text window (kind of anoying with dockpane plugin as it requires 3 classes)
I setup an enviorment with VS2012 and Nw 2013. I built your plugin and it worked well. Could you check my test video?
I think the panel is already truncated the first time you load Navis. Maybe you closed Navis with the panel docked already before you built your solution (started your video).
1. Undock it > close it > then close Navis.
2. Rebuild the plugin > copy the dll like you did > Open Navis
You should have the exact same space between the combobox and the form borders on both side (your video shows the right border is touching the combobox)
3. Now dock the panel > close Navis
4. Reopen Navis
The panel is truncated on the right side (with this example, of only a few pixels, but I have another sample where I loose something like 15 to 25 pts on the right)
yes, the first time I saw your dockpane window is the right border is touching the combobox, but not truncted. And in the first time, it is NOT docked. So I just docked it and restart Navisworks to see if there is any difference.
I do not remember clearly how it looks in the designer of VS. I will take a look at it soon.
I investigated further, and the issue is linked to having control on the form that are anchored both sides; dock (fill, top, bottom...) works fine but anchor produce these truncated results.
So far I have on way around, it is to first put a docked split container with panel2.collapsed set to true, and put all my controls in panel1. I tried with a simple panel but it wasn't fixing the issue, the split container does the job.
Let me know if you find anything else.
I spent some time to test.
Firstly, to clarify: using your plugin, in VS designer of the user control, the right border is not touching the ComboBox. When I tested last time, in the first launching, the right border has started to touch the ComboBox, i.e. the distance between the border and ComboBox became much smaller than designer, but still not truncated (that was why I have a memory the border is touching the BomboBox). While in the second time, it the status is same. So I thought no change.
After I removed plugin, rebuilt and re-deployed, I can obviously see the problem you saw. I cannot see what I tested last time any more :-( I also found: without Anchoring to right, the issue does not occur. However this means the ComboBox will not resize when window changing size. This is not what you expected.
Since in the first message I cannot reproduce with SDK sample, I turned to dig into it. It is written in C#. I tried to add Anchoring like you code. I also tried to create a VB.NET project with your codes. The result is same: the ComboBox does not resize when window changing size. As the two are built in VS2010 (.NET framework 4.0), I started to suspect the framework. So I switched your VS2012 project from 4.5 to 4.0. The result is same to VS2010, i.e. the ComboBox does not resize when window changing size anymore.
Sorry I did not find a solution so far. It is time to report these behaviors with our engineer team.
I just wanted to add if you've tried adding all the form contents to a table layout panel? I usually add a tabled layout panel which is docked to the usercontrol and never had any issues with resizing whether docked or not
Thanks for the reply.
I didn't know about the TableLayoutPanel, I gave it a short try, but I find the layout functionality too restrictive compare to simple Panels.