NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Label.PreferredWidth

Gets the width of the control (in pixels), assuming a single line of text is displayed.

[Visual Basic]
Overridable Public ReadOnly Property PreferredWidth As Integer
[C#]
public int PreferredWidth {virtual get;}
[C++]
public: __property virtual int get_PreferredWidth();
[JScript]
public function get PreferredWidth() : int;

Property Value

The width of the control (in pixels), assuming a single line of text is displayed.

Remarks

This property measures the length of the text string, but does not take line wrapping into consideration. For example, a text string that measures 300 pixels wide could be displayed as three lines in a Label that is only 100 pixels wide. PreferredWidth still returns 300 pixels.

See Also

Label Class | Label Members | System.WinForms Namespace | PreferredHeight