Visual Basic (Declaration) | |
---|---|
Public Property Picture As CheckBoxPicture |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As CheckBoxCellType Dim value As CheckBoxPicture instance.Picture = value value = instance.Picture |
C# | |
---|---|
public CheckBoxPicture Picture {get; set;} |
Property Value
CheckBoxPicture object containing the imageIf you prefer, you can use your own custom pictures for any or all of the pictures that represent the check box states.
Tip: When using custom pictures to represent states, try to create a consistent look and feel for the check box cell. Also, be aware of common interface conventions used to represent states, such as using lighter shades of text or graphics to represent the grayed (indeterminate) state. |
This example sets the properties of a two-state check box in a cell.
C# | Copy Code |
---|---|
FarPoint.Win.Spread.CellType.CheckBoxCellType ckbxcell = new FarPoint.Win.Spread.CellType.CheckBoxCellType(); ckbxcell.Picture(FarPoint.Win.CheckBoxPictureIndex.True) = Image.FromFile("..\\images\\checked.gif"); ckbxcell.Picture(FarPoint.Win.CheckBoxPictureIndex.False) = Image.FromFile("..\\images\\unchecked.gif"); ckbxcell.TextAlign = FarPoint.Win.ButtonTextAlign.TextRightPictLeft; ckbxcell.Caption = "Item Selected?"; fpSpread1.Sheets[0].Cells[2,2].CellType = ckbxcell; |
Visual Basic | Copy Code |
---|---|
Dim ckbxcell As New FarPoint.Win.Spread.CellType.CheckBoxCellType() ckbxcell.Picture(FarPoint.Win.CheckBoxPictureIndex.True) = Image.FromFile("..\images\checked.gif") ckbxcell.Picture(FarPoint.Win.CheckBoxPictureIndex.False) = Image.FromFile("..\images\unchecked.gif") ckbxcell.TextAlign = FarPoint.Win.ButtonTextAlign.TextRightPictLeft ckbxcell.Caption = "Item Selected?" FpSpread1.ActiveSheet.Cells(2,2).CellType = ckbxcell |
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8