Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Bug, anchored control on inherited form, System.Windows.Forms
 

Bug, anchored control on inherited form, System.Windows.Forms

Hi, all

There is such bug: I have base form (class Form1) that has a panel (property Dock has value Bottom ). The panel has anchored protected button (property Anchor has value Bottom, Right ). There is another form inherited from Form1 (Form2). If I change size of second form (Form) in designer, save changes, then the button is shifted from it's anchored place. Is it bug? How to solve this trouble?

Thank's in advance
Anron  Thursday, September 24, 2009 10:48 AM
Okay, I see what you mean. It's definitely a bug IMO. The onlyrelated feedback I could find on Connect was this one. You could try following their workaround (doing the resize in code) or submit a new bug and see if they are prepared to fix it for a new release.
dekurver  Thursday, September 24, 2009 5:33 PM
I'm not able to reproduce this with the controls you described above. Can you provide any more details? In the past I've found that the initial location of anchored controls in a derived form can be wrong, but once you reposition them they are fine and maintain their anchored location.
dekurver  Thursday, September 24, 2009 12:22 PM
There is zipped example project (MS Visual Studio 2005) with trouble http://www.sendspace.com/file/hmqgge
Steps to reproduce:

1. Open Solution.
2. Rebuild Solution.
3. Open Form2 class designer and remember where button (button1 ) is located
4. Change size of the form (for example make it larger)
5. Save changes.
6. Close Form2 designer window
7. Open again Form2 designer and you should see that the button1 is shifted

Thank's in advance
Anron  Thursday, September 24, 2009 12:45 PM
Okay, I see what you mean. It's definitely a bug IMO. The onlyrelated feedback I could find on Connect was this one. You could try following their workaround (doing the resize in code) or submit a new bug and see if they are prepared to fix it for a new release.
dekurver  Thursday, September 24, 2009 5:33 PM

You can use google to search for other answers

Custom Search

More Threads

• Inheriting form class: making MustInherit?
• Custom Designer and Verbs
• User Control
• form deactivate problem
• Controls Location Changed
• Designer moves buttons around
• creating custom events for combo box
• Property To save toolstripbutton
• Creating custom controls
• Finding the PropertyGrid Delete Key Event in VB.NET