// Create a button cell with some options FarPoint.Win.Spread.CellType.ButtonCellType bttncell = new FarPoint.Win.Spread.CellType.ButtonCellType(); bttncell.ButtonColor = Color.Cyan; bttncell.DarkColor = Color.DarkCyan; bttncell.LightColor = Color.AliceBlue; bttncell.TwoState = false; bttncell.Text = "Click and Hold"; bttncell.TextDown = "...now let go."; bttncell.ShadowSize = 3; fpSpread1.Sheets[0].Cells[0,2].CellType = bttncell; ' Create a button cell with some options Dim bttncell As New FarPoint.Win.Spread.CellType.ButtonCellType() bttncell.ButtonColor = Color.Cyan bttncell.DarkColor = Color.DarkCyan bttncell.LightColor = Color.AliceBlue bttncell.TwoState = False bttncell.Text = "Click and Hold" bttncell.TextDown = "...now let go." bttncell.ShadowSize = 3 FpSpread1.Sheets(0).Cells(0,2).CellType = bttncell
// Create a check box cell with some options FarPoint.Win.Spread.CellType.CheckBoxCellType ckbxcell = new FarPoint.Win.Spread.CellType.CheckBoxCellType(); ckbxcell.ThreeState = true; ckbxcell.TextTrue ="Checked"; ckbxcell.TextFalse ="Unchecked"; ckbxcell.TextIndeterminate ="Not Sure"; fpSpread1.ActiveSheet.Cells[0, 0].CellType = ckbxcell; ' Create a check box cell with some options Dim ckbxcell As New FarPoint.Win.Spread.CellType.CheckBoxCellType() ckbxcell.ThreeState = true ckbxcell.TextTrue ="Checked" ckbxcell.TextFalse ="Unchecked" ckbxcell.TextIndeterminate ="Not Sure" FpSpread1.ActiveSheet.Cells(0, 0).CellType = ckbxcell
// Create a combo box cell with some options FarPoint.Win.Spread.CellType.ComboBoxCellType cmbocell = new FarPoint.Win.Spread.CellType.ComboBoxCellType(); cmbocell.Items = (new String[] {"January", "February", "March", "April", "May", "June"}); cmbocell.AutoSearch = FarPoint.Win.AutoSearch.SingleCharacter; cmbocell.Editable = true; cmbocell.MaxDrop = 4; fpSpread1.ActiveSheet.Cells[0, 0].CellType = cmbocell; ' Create a combo box cell with some options Dim cbstr As string( ) cbstr = new String() {"Jan", "Feb", "Mar", "Apr", "May", "Jun"} Dim cmbocell As New FarPoint.Win.Spread.CellType.ComboBoxCellType() cmbocell.Items = cbstr cmbocell.AutoSearch = FarPoint.Win.AutoSearch.SingleCharacter cmbocell.Editable = True cmbocell.MaxDrop = 4 FpSpread1.ActiveSheet.Cells(0, 0).CellType = cmbocell
' Create and bind a multiple-column combo box cell Dim mcb As New FarPoint.Win.Spread.CellType.MultiColumnComboBoxCellType() mcb.DataSourceList = myDataSet mcb.DataColumn = 1 mcb.ButtonAlign = FarPoint.Win.ButtonAlign.Right mcb.ListWidth = 500 mcb.ListOffset = 5 mcb.MaxDrop = 5 FpSpread1.ActiveSheet.Cells(0, 0).CellType = mcb
// Create a hyperlink cell with some options FarPoint.Win.Spread.CellType.HyperLinkCellType hlnkcell = new FarPoint.Win.Spread.CellType.HyperLinkCellType(); hlnkcell.Text = "Click to See Our Web Site"; hlnkcell.Link ="http://www.fpoint.com"; hlnkcell.LinkArea = new LinkArea(9,25); hlnkcell.LinkColor = Color.DarkSlateBlue; fpSpread1.ActiveSheet.Cells[1, 1].CellType = hlnkcell; ' Create a hyperlink cell with some options Dim hlnkcell As New FarPoint.Win.Spread.CellType.HyperLinkCellType() hlnkcell.Text = "Click to See Our Web Site" hlnkcell.Link ="http://www.fpoint.com" hlnkcell.LinkArea = new LinkArea(9,25) hlnkcell.LinkColor = Color.DarkSlateBlue FpSpread2.ActiveSheet.Cells(1, 1).CellType = hlnkcell
// Create a image cell FarPoint.Win.Spread.CellType.ImageCellType icelltype = new FarPoint.Win.Spread.CellType.ImageCellType(); fpSpread1.Sheets[0].Rows[0].CellType =icelltype; System.Drawing.Image image = System.Drawing.Image.FromFile("C:\\picture.jpg"); fpSpread1.Sheets[0].Cells[0,0].Value = image; ' Create a image cell Dim icelltype As New FarPoint.Win.Spread.CellType.ImageCellType() FpSpread1.Sheets(0).Rows(0).CellType = icelltype Dim image As System.Drawing.Image = System.Drawing.Image.FromFile("C:\picture.jpg") FpSpread1.Sheets(0).Cells(0, 0).Value = image
' Create a list box cell Dim listcell As New FarPoint.Win.Spread.CellType.ListBoxCellType() listcell.ImageList = ImageList1 listcell.ItemData = New String() {"One", "Two", "Three"} listcell.Items = New String() {"One", "Two", "Three"} listcell.ItemHeight = 40 FpSpread1.ActiveSheet.Cells(0, 0).CellType = listcell
// Create a progress indicator cell FarPoint.Win.Spread.CellType.ProgressCellType progcell = new FarPoint.Win.Spread.CellType.ProgressCellType(); progcell.FillColor = Color.Red; fpSpread1.ActiveSheet.Cells[0, 0].CellType = progcell; ' Create a progress indicator cell Dim progcell As New FarPoint.Win.Spread.CellType.ProgressCellType() progcell.FillColor = Color.Red FpSpread1.ActiveSheet.Cells(0, 0).CellType = progcell
// Create a rich text cell FarPoint.Win.Spread.CellType.RichTextCellType rtf = new FarPoint.Win.Spread.CellType.RichTextCellType(); rtf.WordWrap = true; rtf.Multiline = true; fpSpread1.ActiveSheet.Cells[0, 0].CellType = rtf; ' Create a rich text cell Dim rtf As New FarPoint.Win.Spread.CellType.RichTextCellType() rtf.WordWrap = True rtf.Multiline = True FpSpread1.ActiveSheet.Cells(0, 0).CellType = rtf
// Create a slider cell with a few options FarPoint.Win.Spread.CellType.SliderCellType sldrcell = new FarPoint.Win.Spread.CellType.SliderCellType(); sldrcell.KnobColor = Color.Green; sldrcell.TrackColor = Color.Yellow; fpSpread1.ActiveSheet.Cells[0, 0].CellType = sldrcell; ' Create a slider cell with a few options Dim sldrcell As New FarPoint.Win.Spread.CellType.SliderCellType() sldrcell.KnobColor = Color.Green sldrcell.TrackColor = Color.Yellow FpSpread1.ActiveSheet.Cells(0, 0).CellType = sldrcell