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