VisualStyleRenderer.GetTextExtent Método

Definição

Devolve o tamanho e a localização da cadeia especificada quando desenhada com a fonte do elemento visual atual.

Sobrecargas

Name Description
GetTextExtent(IDeviceContext, String, TextFormatFlags)

Devolve o tamanho e a localização da cadeia especificada quando desenhada com a fonte do elemento visual atual.

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

Devolve o tamanho e a localização da string especificada quando desenhada com a fonte do elemento de estilo visual atual dentro do retângulo delimitador inicial especificado.

GetTextExtent(IDeviceContext, String, TextFormatFlags)

Devolve o tamanho e a localização da cadeia especificada quando desenhada com a fonte do elemento visual atual.

public:
 System::Drawing::Rectangle GetTextExtent(System::Drawing::IDeviceContext ^ dc, System::String ^ textToDraw, System::Windows::Forms::TextFormatFlags flags);
public System.Drawing.Rectangle GetTextExtent(System.Drawing.IDeviceContext dc, string textToDraw, System.Windows.Forms.TextFormatFlags flags);
member this.GetTextExtent : System.Drawing.IDeviceContext * string * System.Windows.Forms.TextFormatFlags -> System.Drawing.Rectangle
Public Function GetTextExtent (dc As IDeviceContext, textToDraw As String, flags As TextFormatFlags) As Rectangle

Parâmetros

dc
IDeviceContext

Esta IDeviceContext operação irá usar.

textToDraw
String

A cadeia a medir.

flags
TextFormatFlags

Uma combinação bit a bit dos TextFormatFlags valores.

Devoluções

A Rectangle que contém a área necessária para se ajustar ao texto renderizado.

Exceções

dc é null.

Aplica-se a

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

Devolve o tamanho e a localização da string especificada quando desenhada com a fonte do elemento de estilo visual atual dentro do retângulo delimitador inicial especificado.

public:
 System::Drawing::Rectangle GetTextExtent(System::Drawing::IDeviceContext ^ dc, System::Drawing::Rectangle bounds, System::String ^ textToDraw, System::Windows::Forms::TextFormatFlags flags);
public System.Drawing.Rectangle GetTextExtent(System.Drawing.IDeviceContext dc, System.Drawing.Rectangle bounds, string textToDraw, System.Windows.Forms.TextFormatFlags flags);
member this.GetTextExtent : System.Drawing.IDeviceContext * System.Drawing.Rectangle * string * System.Windows.Forms.TextFormatFlags -> System.Drawing.Rectangle
Public Function GetTextExtent (dc As IDeviceContext, bounds As Rectangle, textToDraw As String, flags As TextFormatFlags) As Rectangle

Parâmetros

dc
IDeviceContext

Esta IDeviceContext operação irá usar.

bounds
Rectangle

A Rectangle era usado para controlar o fluxo e o enrolamento do texto.

textToDraw
String

A cadeia a medir.

flags
TextFormatFlags

Uma combinação bit a bit dos TextFormatFlags valores.

Devoluções

A Rectangle que contém a área necessária para se ajustar ao texto renderizado.

Exceções

dc é null.

Aplica-se a