...
Description |
---|
Excerpt |
---|
Returns the minimum height required to fit the given text string using the given font. |
Signature | ||||
---|---|---|---|---|
| ||||
public double GetTextHeight(System.String text, Font font, double desiredWidth)
{signature}{signature: |
Signature | ||||||
---|---|---|---|---|---|---|
| }
| |||||
Public Function GetTextHeight(ByVal text As String, ByVal font As Font, ByVal desiredWidth As Double) As Double
{signature}
{parameters}
{param:text}The text string whose height will be calculated.{param}
{param:font}The font that will be used to format the text.{param}
{param:desiredWidth}The width, in character units, of the cell or area into which the text will be inserted.{param}
{returns}The minimum height, in character units, required to accommodate the given text string.{returns}
{remarks}
The maximum height of any one row is 409 units, so if the height return is greater than 409, you must merge cells across multiple rows and set the height of each row to accommodate the total minimum height of the text.
{remarks}
{example}{code:csharp|title=C#} |
Parameters |
---|
Param | ||||
---|---|---|---|---|
| ||||
The text string whose height will be calculated. |
Param | ||||
---|---|---|---|---|
| ||||
The font that will be used to format the text. |
Param | ||||
---|---|---|---|---|
| ||||
The width, in character units, of the cell or area into which the text will be inserted. |
Returns |
---|
The minimum height, in character units, required to accommodate the given text string. |
Remarks |
---|
The maximum height of any one row is 409 units, so if the height return is greater than 409, you must merge cells across multiple rows and set the height of each row to accommodate the total minimum height of the text. |
Example | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|