Skip to main content

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.

public class StringFormat : MarshalByRefObject, ICloneable, IDisposable

Constructors​

Instance member StringFormat()​

Initializes a new instance of the StringFormat class.

Instance member StringFormat(options)​

Initializes a new instance of the StringFormat class.

NameTypeDescription
optionsStringFormatFlagsThe StringFormatFlags enumeration for the new StringFormat object.

Instance member StringFormat(options, language)​

Initializes a new instance of the StringFormat class.

NameTypeDescription
optionsStringFormatFlagsThe StringFormatFlags enumeration for the new StringFormat object.
languageInt32A value that indicates the language of the text.

Instance member StringFormat(format)​

Initializes a new instance of the StringFormat class.

NameTypeDescription
formatStringFormatThe StringFormat object from which to initialize the new StringFormat object.

Properties​

Instance member Alignment​

StringAlignment: Gets or sets horizontal alignment of the string.

Instance member FormatFlags​

StringFormatFlags: Gets or sets a StringFormatFlags enumeration that contains formatting information.

Static member 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.

Static member 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.

Instance member HotkeyPrefix​

HotkeyPrefix: Gets or sets the HotkeyPrefix object for this StringFormat object.

Instance member LineAlignment​

StringAlignment: Gets or sets the vertical alignment of the string.

Instance member Trimming​

StringTrimming: Gets or sets the StringTrimming enumeration for this StringFormat object.

Methods​

Instance member Clone()​

Returns: Object.

Instance member Dispose()​