FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > ButtonCellType Class > ButtonCellType Constructor : ButtonCellType Constructor(String,String) |
'Usage Dim cmd As String Dim text As String Dim instance As New ButtonCellType(cmd, text)
FarPoint.Web.Spread.ButtonCellType btn=new FarPoint.Web.Spread.ButtonCellType("MyRed","Red"); FarPoint.Web.Spread.ButtonCellType btn1=new FarPoint.Web.Spread.ButtonCellType("MyBlue","Blue"); FarPoint.Web.Spread.StyleInfo style=new FarPoint.Web.Spread.StyleInfo(); FarPoint.Web.Spread.StyleInfo style1=new FarPoint.Web.Spread.StyleInfo(); FpSpread1.Sheets[0].ColumnCount=7; FpSpread1.Sheets[0].RowCount=50; style.CellType=btn; style1.CellType=btn1; FpSpread1.Sheets[0].SetStyleInfo(-1,0,style); FpSpread1.Sheets[0].SetStyleInfo(-1,1,style1); private void FpSpread1_ButtonCommand(object sender,FarPoint.Web.Spread.SpreadCommandEventArgs e) { if(e.CommandName=="MyRed") { FpSpread1.Sheets[0].BackColor=Color.Red; } else if(e.CommandName=="MyBlue") { FpSpread1.Sheets[0].BackColor=Color.Blue; } }
Dim btn As New FarPoint.Web.Spread.ButtonCellType("MyRed","Red") Dim btn1 As New FarPoint.Web.Spread.ButtonCellType("MyBlue","Blue") Dim style As New FarPoint.Web.Spread.StyleInfo() Dim style1 As New FarPoint.Web.Spread.StyleInfo() FpSpread1.Sheets(0).ColumnCount=7 FpSpread1.Sheets(0).RowCount=50 style.CellType=btn style1.CellType=btn1 FpSpread1.Sheets(0).SetStyleInfo(-1,0,style) FpSpread1.Sheets(0).SetStyleInfo(-1,1,style1) Private Sub FpSpread1_ButtonCommand(ByVal sender As Object,ByVal e AsFarPoint.Web.Spread.SpreadCommandEventArgs)Handles FpSpread1.ButtonCommand If e.CommandName="MyRed" Then FpSpread1.Sheets(0).BackColor=Color.Red Else If e.CommandName="MyBlue" Then FpSpread1.Sheets(0).BackColor=Color.Blue End If End Sub
Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional