VisualStyleRenderer.GetTextExtent Método

Definição

Retorna o tamanho e o local da cadeia de caracteres especificada quando desenhado com a fonte do elemento de estilo visual atual.

Sobrecargas

Nome Description
GetTextExtent(IDeviceContext, String, TextFormatFlags)

Retorna o tamanho e o local da cadeia de caracteres especificada quando desenhado com a fonte do elemento de estilo visual atual.

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

Retorna o tamanho e o local da cadeia de caracteres especificada quando desenhado com a fonte do elemento de estilo visual atual dentro do retângulo delimitador inicial especificado.

GetTextExtent(IDeviceContext, String, TextFormatFlags)

Retorna o tamanho e o local da cadeia de caracteres especificada quando desenhado com a fonte do elemento de estilo 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

A IDeviceContext operação será usada.

textToDraw
String

A cadeia de caracteres a ser medida.

flags
TextFormatFlags

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

Retornos

Um Rectangle que contém a área necessária para ajustar o texto renderizado.

Exceções

dc é null.

Aplica-se a

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

Retorna o tamanho e o local da cadeia de caracteres especificada quando desenhado 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

A IDeviceContext operação será usada.

bounds
Rectangle

Um Rectangle usado para controlar o fluxo e o encapsulamento do texto.

textToDraw
String

A cadeia de caracteres a ser medida.

flags
TextFormatFlags

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

Retornos

Um Rectangle que contém a área necessária para ajustar o texto renderizado.

Exceções

dc é null.

Aplica-se a