[]
        
(Showing Draft Content)

FarPoint.Win.FpButton.GetPreferredSize

GetPreferredSize Method

GetPreferredSize(Graphics, Size, Font, string, string, ButtonTextAlign, bool, int, Image, Image)

Calculates the height and width required to display the button text and picture.

Declaration
public static Size GetPreferredSize(Graphics g, Size size, Font font, string text, string textDown, ButtonTextAlign nAlign, bool wordWrap, int shadowSize, Image pictUp, Image pictDown)
Public Shared Function GetPreferredSize(g As Graphics, size As Size, font As Font, text As String, textDown As String, nAlign As ButtonTextAlign, wordWrap As Boolean, shadowSize As Integer, pictUp As Image, pictDown As Image) As Size
Parameters
Type Name Description
Graphics g

GDI+ graphics surface

Size size

Size

Font font

Font

string text

Text of button when not pressed

string textDown

Text of button when pressed

ButtonTextAlign nAlign

Alignment of text

bool wordWrap

Whether text wraps to multiple lines

int shadowSize

Size of shadow around button

Image pictUp

Picture (image) when button is not pressed

Image pictDown

Picture (image) when button is pressed

Returns
Type Description
Size

GetPreferredSize(Graphics, Size, Font, string, string, ButtonTextAlign, TextOrientation, bool, int, Image, Image, HotkeyPrefix)

Calculates the height and width required to display the button text and picture.

Declaration
public static Size GetPreferredSize(Graphics g, Size size, Font font, string text, string textDown, ButtonTextAlign nAlign, TextOrientation textOrientation, bool wordWrap, int shadowSize, Image pictUp, Image pictDown, HotkeyPrefix prefix)
Public Shared Function GetPreferredSize(g As Graphics, size As Size, font As Font, text As String, textDown As String, nAlign As ButtonTextAlign, textOrientation As TextOrientation, wordWrap As Boolean, shadowSize As Integer, pictUp As Image, pictDown As Image, prefix As HotkeyPrefix) As Size
Parameters
Type Name Description
Graphics g

GDI+ graphics surface

Size size

Size

Font font

Font

string text

Text of button when not pressed

string textDown

Text of button when pressed

ButtonTextAlign nAlign

Alignment of text

TextOrientation textOrientation

Text orientation

bool wordWrap

Whether text wraps to multiple lines

int shadowSize

Size of shadow around button

Image pictUp

Picture when button is not pressed

Image pictDown

Picture when button is pressed

HotkeyPrefix prefix

Hotkey prefix

Returns
Type Description
Size

GetPreferredSize(Graphics, Size, Font, string, string, ButtonTextAlign, TextOrientation, bool, int, Image, Image, HotkeyPrefix, double)

Calculates the height and width required to display the button text and picture.

Declaration
public static Size GetPreferredSize(Graphics g, Size size, Font font, string text, string textDown, ButtonTextAlign nAlign, TextOrientation textOrientation, bool wordWrap, int shadowSize, Image pictUp, Image pictDown, HotkeyPrefix prefix, double angle)
Public Shared Function GetPreferredSize(g As Graphics, size As Size, font As Font, text As String, textDown As String, nAlign As ButtonTextAlign, textOrientation As TextOrientation, wordWrap As Boolean, shadowSize As Integer, pictUp As Image, pictDown As Image, prefix As HotkeyPrefix, angle As Double) As Size
Parameters
Type Name Description
Graphics g

GDI+ graphics surface

Size size

Size

Font font

Font

string text

Text of button when not pressed

string textDown

Text of button when pressed

ButtonTextAlign nAlign

Alignment of text

TextOrientation textOrientation

Text orientation

bool wordWrap

Whether text wraps to multiple lines

int shadowSize

Size of shadow around button

Image pictUp

Picture when button is not pressed

Image pictDown

Picture when button is pressed

HotkeyPrefix prefix

HotkeyPrefix

double angle

The text rotation angle.

Returns
Type Description
Size

GetPreferredSize(FpButtonPaintArgs)

Calculates the height and width required to display the button text and picture.

Declaration
public static Size GetPreferredSize(FpButtonPaintArgs args)
Public Shared Function GetPreferredSize(args As FpButtonPaintArgs) As Size
Parameters
Type Name Description
FpButtonPaintArgs args

The arguments for getting preferred size. NOTE: Just listed arguments here affect to the result args.g, args.r.Size, args.font, args.text, args.textDown, args.nAlign, args.halign, args.valign, args.textOrientation, args.wordWrap, args.shadowSize, args.pictUp, args.pictDown, args.prefix, args.txtRotationAngle, args.rightToLeft, args.pressed, args.getPreferredSizeDirection

Returns
Type Description
Size