Calculates the height and width required to display the button text and picture.
Syntax
'Declaration
Public Overloads Shared Function GetPreferredSize( _
ByVal As Graphics, _
ByVal As Size, _
ByVal As Font, _
ByVal As String, _
ByVal As String, _
ByVal As ButtonTextAlign, _
ByVal As TextOrientation, _
ByVal As Boolean, _
ByVal shadowSize As Integer, _
ByVal As Image, _
ByVal As Image, _
ByVal As HotkeyPrefix, _
ByVal As Double _
) As Size
'Usage
Dim g As Graphics
Dim size As Size
Dim font As Font
Dim text As String
Dim textDown As String
Dim nAlign As ButtonTextAlign
Dim textOrientation As TextOrientation
Dim wordWrap As Boolean
Dim shadowSize As Integer
Dim pictUp As Image
Dim pictDown As Image
Dim prefix As HotkeyPrefix
Dim angle As Double
Dim value As Size
value = FpButton.GetPreferredSize(g, size, font, text, textDown, nAlign, textOrientation, wordWrap, shadowSize, pictUp, pictDown, prefix, angle)
public static Size GetPreferredSize(
Graphics ,
Size ,
Font ,
string ,
string ,
ButtonTextAlign ,
TextOrientation ,
bool ,
int shadowSize,
Image ,
Image ,
HotkeyPrefix ,
double
)
Parameters
- g
- GDI+ graphics surface
- size
- Size
- font
- Font
- text
- Text of button when not pressed
- textDown
- Text of button when pressed
- nAlign
- Alignment of text
- textOrientation
- Text orientation
- wordWrap
- Whether text wraps to multiple lines
- shadowSize
- Size of shadow around button
- pictUp
- Picture when button is not pressed
- pictDown
- Picture when button is pressed
- prefix
- HotkeyPrefix
- angle
- The text rotation angle.
See Also