System.Drawing.Size.ToString C# (CSharp) Method

ToString() public method

Creates a human-readable string that represents this .

public ToString ( ) : string
return string
        public override string ToString() => "{Width=" + _width.ToString() + ", Height=" + _height.ToString() + "}";
    }

Usage Example

Ejemplo n.º 1
0
        internal override Size GetPreferredSize(IArrangedElement container, Size proposedConstraints) {
#if DEBUG        
            if (CompModSwitches.FlowLayout.TraceInfo) {            
                Debug.WriteLine("FlowLayout::GetPreferredSize("
                    + "container=" + container.ToString() + ", "
                    + "proposedConstraints=" + proposedConstraints.ToString() + ")");
                Debug.Indent();
            }
#endif
            Rectangle measureBounds = new Rectangle(new Point(0, 0), proposedConstraints);
            Size prefSize = xLayout(container, measureBounds, /* measureOnly = */ true);

            if(prefSize.Width > proposedConstraints.Width || prefSize.Height> proposedConstraints.Height) {
                // Controls measured earlier than a control which couldn't be fit to constraints may
                // shift around with the new bounds.  We need to make a 2nd pass through the
                // controls using these bounds which are gauranteed to fit.
                measureBounds.Size = prefSize;
                prefSize = xLayout(container, measureBounds, /* measureOnly = */ true);
            }

#if DEBUG
            if (CompModSwitches.FlowLayout.TraceInfo) {
                Debug.Unindent();
                Debug.WriteLine("GetPreferredSize returned " + prefSize);
            }
#endif
            return prefSize;
        }
All Usage Examples Of System.Drawing.Size::ToString