VisualStyleRenderer.GetTextExtent Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
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
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
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.