I found the problem after a night of testing. It seems to be a bug in UIStudio rather than in VS 2005:
In an earlier thread, I told you about the bug in UIStudio: when docking tool windows at the right side at design time and autohiding them, they "jump" to the left side once you open and pinpoint them.
To work around this issue, in my form_load I used this code:
Dim toolwindow As ToolWindow
For Each toolwindow In DockManager.ToolWindows
ToolWindow.State = ToolWindowState.AutoHide
Next
Next, I needed to attach them similar to your sample code because although they were grouped in design time, groups broke up for some reason.
I set the controls to "dock" instead of "autohide" at design time, and programmatically they were autohidden/attached and did no longer jump to the other side when pinpointing them. I *thought* I did it at this point.
However, these lines also cause the strange behavior I described in this thread, breaking groupings.
I removed the lines, and everything works fine now except for the original "jumping" bug.
I narrowed it down, and you can see this behavior in design time, as well:
If you group some tool windows and then select AutoHide for one or all of the tool windows in the group, the group is broken up.
Let's say you did autohide all tool windows of a group at design time. They will display as non-grouped tool windows in design time. When you launch the app, they again appear as autohidden group. Once you pinpoint one toolwindow out of the group, everything breaks up, though, and the tool windows turn out to be non-grouped tool windows, after all.
This explains what had happened in my case:
I hide the windows programmatically, and when I do this, the same happens that occured in design view: the groups are broken up. I then attached the tool windows again like you did in your sample code. They again appeared to be a group. However, the moment I pinpoint one toolwindow, the group breaks up again.
The only way to get autohidden groups is to not hide them in design view and call this method in form_load:
AutoHideAllToolWindowsDockedInHost
However, I still think there is something wrong with the control.
[Modified at 06/17/2005 03:33 AM]