Spread Windows Forms 15.0
FarPoint.Win Assembly / FarPoint.Win Namespace / FpCheckBox Class / GetPreferredSize Method / GetPreferredSize(Graphics,Size,Object,Font,String,String,String,String,CheckBoxPicture,ButtonTextAlign,Boolean,Boolean,HotkeyPrefix) Method
Graphics device interface for drawing; GDI+ graphics surface
Preferred or maximum needed size
CheckState constant specifying the check box state, or null (or non-CheckState value) to use as the current state of the check box
Font for computing the height and width
String of text when the check box is checked (true)
String of text when the check box is unchecked (false)
String of text when the check box is gray (indeterminate)
String of text if none of the other text values are set
Picture (image) for the check box
Alignment of the text and check box
Whether the key down
Whether the mouse down
Hotkey prefix


In This Topic
    GetPreferredSize(Graphics,Size,Object,Font,String,String,String,String,CheckBoxPicture,ButtonTextAlign,Boolean,Boolean,HotkeyPrefix) Method
    In This Topic
    Calculates the height and width to display the text and picture in the check box.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function GetPreferredSize( _
       ByVal g As Graphics, _
       ByVal size As Size, _
       ByVal value As Object, _
       ByVal f As Font, _
       ByVal textTrue As String, _
       ByVal textFalse As String, _
       ByVal textGray As String, _
       ByVal caption As String, _
       ByVal pict As CheckBoxPicture, _
       ByVal align As ButtonTextAlign, _
       ByVal bKeyDown As Boolean, _
       ByVal bMouseDown As Boolean, _
       ByVal prefix As HotkeyPrefix _
    ) As Size
    'Usage
     
    
    Dim g As Graphics
    Dim size As Size
    Dim value As Object
    Dim f As Font
    Dim textTrue As String
    Dim textFalse As String
    Dim textGray As String
    Dim caption As String
    Dim pict As CheckBoxPicture
    Dim align As ButtonTextAlign
    Dim bKeyDown As Boolean
    Dim bMouseDown As Boolean
    Dim prefix As HotkeyPrefix
    Dim value As Size
     
    value = FpCheckBox.GetPreferredSize(g, size, value, f, textTrue, textFalse, textGray, caption, pict, align, bKeyDown, bMouseDown, prefix)

    Parameters

    g
    Graphics device interface for drawing; GDI+ graphics surface
    size
    Preferred or maximum needed size
    value
    CheckState constant specifying the check box state, or null (or non-CheckState value) to use as the current state of the check box
    f
    Font for computing the height and width
    textTrue
    String of text when the check box is checked (true)
    textFalse
    String of text when the check box is unchecked (false)
    textGray
    String of text when the check box is gray (indeterminate)
    caption
    String of text if none of the other text values are set
    pict
    Picture (image) for the check box
    align
    Alignment of the text and check box
    bKeyDown
    Whether the key down
    bMouseDown
    Whether the mouse down
    prefix
    Hotkey prefix
    See Also