Bug in VS 2005?

D

David Veeneman

I think I may have stumbled across a bug in Visual Studio 2005, .NET 2.0, or
both. The Anchor property doesn't seem to work if a form's size is bound to
a user setting.

To reproduce the problem:

1. Create a Windows Forms application.

2. Add a label to Form1. Change the background color of the label to a color
that contrasts with the form. I used red. Resize the label so that it fills
Form1.

4. Set the label's Anchor property to Top, Left, Right, Bottom.

5. In the Properties window for Form1, under '(ApplicationSettings)', click
the '(PropertyBinding' elipsis and create a new binding for the ClientSize
property.

6. Create an event handler for Form1's FormClosing event and add a call to
Settings.Default.Save() to the handler.

7. Run the app. The label should fill the form. Resize the app. The label
should grow with the form. Close the app.

8. Restart the app. The label will no longer fill the form. It will still
hold its original size.

The problem doesn't occur with docked controls. As a workaround, I am
docking whenever I can. If I have to anchor, I am binding the size property
to a user setting, so that it will remember its size from session to
session.
 
G

Guest

David,

I have had similar problems with trying to base the size of a contained
object on it's container. The issue is the order in which the sizes are
established at runtime. An interesting thing occurs sometimes when a
contained items value is incompatible with it's container at design time. In
1.1 it would cause a stack overflow. In 2.0 the IDE simply aborts and
disappears without any message. (Yeah!)

Jerry
 
D

David Veeneman

Actually, I have tried that. The process for submitting a bug is
complicated, and I don't care to spend the time it takes to do it. to tell
the truth, I have lost faith in Microsoft's commitment to fixing known bugs,
given the notorious bugs that have remained through several iterations of
..NET. An example is the famous Tab control bug that keeps controls on
inactive pages from being updated. People have been complaining about it for
years, and it shows up again in .NET 2.0. There is no excuse for that.

So, why should I spend fifteen minutes of my time submitting the bug to
Microsoft? I'd rather just pass along the information to the rest of the
developer community, so that the next person researching the issue doesn't
go through what I did.

Sorry for the rant, but this is a real sore spot with me. <g>
 
F

Fred Chateau

...
People have been complaining about it for years, and it shows up again in
.NET 2.0. There is no excuse for that.
So, why should I spend fifteen minutes of my time submitting the bug to
Microsoft?

Hmm... Maybe so we won't have to wait around several more years and see it
show up again in the next version? :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top