StringFormat
Namespace: System.Drawing
Assembly: System.Drawing.Managed (4.0.0.0)
Encapsulates text layout information (such as alignment, orientation and tab stops), display manipulations (such as ellipsis insertion and national digit substitution) and OpenType features. This class cannot be inherited.
- C#
- VB.NET
public class StringFormat : MarshalByRefObject, ICloneable, IDisposable
Public Class StringFormat
Inherits MarshalByRefObject
Implements ICloneable, IDisposable
Constructors
StringFormat()
Initializes a new instance of the StringFormat class.
StringFormat(options)
Initializes a new instance of the StringFormat class.
| Name | Type | Description |
|---|---|---|
| options | StringFormatFlags | The StringFormatFlags enumeration for the new StringFormat object. |
StringFormat(options, language)
Initializes a new instance of the StringFormat class.
| Name | Type | Description |
|---|---|---|
| options | StringFormatFlags | The StringFormatFlags enumeration for the new StringFormat object. |
| language | Int32 | A value that indicates the language of the text. |
StringFormat(format)
Initializes a new instance of the StringFormat class.
| Name | Type | Description |
|---|---|---|
| format | StringFormat | The StringFormat object from which to initialize the new StringFormat object. |
Properties
Alignment
StringAlignment: Gets or sets horizontal alignment of the string.
FormatFlags
StringFormatFlags: Gets or sets a StringFormatFlags enumeration that contains formatting information.
GenericDefault
StringFormat: Gets a generic default StringFormat. A generic, default StringFormat object has the following characteristics:
- No string format flags are set.
- Character alignment and line alignment are set to Near.
- Language ID is set to neutral language, which means that the current language associated with the calling thread is used.
- Hot key prefix is set to None.
- String trimming is set to Character.
GenericTypographic
StringFormat: Gets a generic typographic StringFormat. A generic, typographic StringFormat object has the following characteristics:
- Format flags are set to NoClip, FitBlackBox and LineLimit.
- Character alignment and line alignment are set to Near.
- Language ID is set to neutral language, which means that the current language associated with the calling thread is used.
- Hot key prefix is set to None.
- String trimming is set to Character.
HotkeyPrefix
HotkeyPrefix: Gets or sets the HotkeyPrefix object for this StringFormat object.
LineAlignment
StringAlignment: Gets or sets the vertical alignment of the string.
Trimming
StringTrimming: Gets or sets the StringTrimming enumeration for this StringFormat object.
Methods
Clone()
Returns: Object.