Unable to change BarManager in Subclassed Window

Bars for Windows Forms Forum

Posted 15 years ago by Anthony Martin
Version: 2.0.73
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Unfortunately, I'm not able to send you a zip of the project but here's what I do.

1. Create a new windows application project
2. Create a new user control with a bar manager and set it and dock areas to protected
3. Add a new dockable toolbar
4. Build (so that VS recognizes the class)
4. Subclass off the user control
5. Create new commands
6. Drag and drop the commands onto the original tool bar (they will appear within the tool bar).
7. Add the second user control onto Form1.
8. Build and run.
9. The commands won't appear in the new tool bar.

The reason this is happening is that the source code never gets generated within InitializeComponent even though it appears it is in the designer. If you try to add anything to the bar manager from the subclassed component, code is not automatically generated.

Comments (1)

This is a known issue that we've worked with another customer on but have unable to find a way to handle it because of the ways the designer serializes code.

The problem is that we made commands and links inherit Object instead of Component and from our previous testing it appears that the VS designer will not serialize object collection to code in inherited forms. So the end result is as you've seen, where you can change things in the inherited form but they won't serialize to code.

We have spent a lot of time trying to find a workaround but have not been able to come up with anything thus far.

Actipro Software Support

The latest build of this product (v21.1.0) was released 15 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.