-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Documentation Incorrect #761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I wonder if it's a bug in documentation or implementation? if (_all || _left != value) {
_all = false;
_left = value;
} can be improved like this, for example: if (_left == value) return;
_left = value;
_all = _top == _left && _top == _right && _top == _bottom; |
That's right: The implementation is wrong, but I don't think that they will change it, because thats would break people's existing code. |
@Tanya-Solyanik can you comment on this one? There's an indication that this is a product bug, but let me know if you'd like to just document the behavior as-is. |
This might be a product bug, but, like HeinzKessler said, it would be a breaking change to fix this and the workaround is simple. As is 'Padding.All |
Or during construction. Both by the one-parameter constructor and by the four-parameter constructor if it gets all four the same values: |
The statement under "Remarks" is not correct: If the values for Top, Bottom, Left, or Rights were set separately, then All returns -1, even if all 4 properties have the same value:
var p = new Padding( 5 );
// Here, All returns 5
p.Left = 5;
// Now, All returns -1, although all 4 properties still have a value of 5
p.All = 5;
// Now, All returns 5 again
see also: https://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/Padding.cs,6c9dc153b2c496ae
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: