Spread Windows Forms 6.0 Product Documentation
GetPreferredSize(Graphics,Size,Font,String,String,ButtonTextAlign,TextOrientation,Boolean,Int32,Image,Image,HotkeyPrefix,Double) Method
See Also  Support Options
FarPoint.Win Assembly > FarPoint.Win Namespace > FpButton Class > GetPreferredSize Method : GetPreferredSize(Graphics,Size,Font,String,String,ButtonTextAlign,TextOrientation,Boolean,Int32,Image,Image,HotkeyPrefix,Double) Method


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.

Glossary Item Box

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

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Function GetPreferredSize( _
   ByVal g As Graphics, _
   ByVal size As Size, _
   ByVal font As Font, _
   ByVal text As String, _
   ByVal textDown As String, _
   ByVal nAlign As ButtonTextAlign, _
   ByVal textOrientation As TextOrientation, _
   ByVal wordWrap As Boolean, _
   ByVal shadowSize As Integer, _
   ByVal pictUp As Image, _
   ByVal pictDown As Image, _
   ByVal prefix As HotkeyPrefix, _
   ByVal angle As Double _
) As Size
Visual Basic (Usage)Copy Code
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)
C# 
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
)

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.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.