private void Form1_Load(object sender, System.EventArgs e)
{
fpSpread1.ActiveSheet.RowCount = 5;
fpSpread1.ActiveSheet.ColumnCount = 5;
fpSpread1.ActiveSheet.Rows[0].BackColor = Color.LemonChiffon;
fpSpread1.ActiveSheet.Rows[1].BackColor = Color.LightCyan;
fpSpread1.ActiveSheet.Rows[2].BackColor = Color.LightPink;
fpSpread1.ActiveSheet.Rows[3].BackColor = Color.LightGreen;
fpSpread1.ActiveSheet.Rows[4].BackColor = Color.LightCoral;
FarPoint.Win.Spread.Model.CellRange cr = new FarPoint.Win.Spread.Model.CellRange(1, 1, 3, 3);
fpSpread1.ActiveSheet.SetOutlineBorder(cr, new FarPoint.Win.LineBorder(Color.Blue, 2));
fpSpread1.ActiveSheet.Columns[0].Font = new Font("Arial", 12, FontStyle.Bold | FontStyle.Italic);
fpSpread1.ActiveSheet.Columns[0].ForeColor = Color.Blue;
fpSpread1.ActiveSheet.Columns[0].CellType = new FarPoint.Win.Spread.CellType.TextCellType();
fpSpread1.ActiveSheet.SetText(0, 0, "Excel");
fpSpread1.ActiveSheet.AddSpanCell(4, 0, 1, 2);
fpSpread1.ActiveSheet.SetText(4, 0, "SPREAD for .NET");
fpSpread1.ActiveSheet.Columns[1].CellType = new FarPoint.Win.Spread.CellType.DateTimeCellType();
fpSpread1.ActiveSheet.SetColumnWidth(1, 90);
fpSpread1.ActiveSheet.AddSpanCell(1, 1, 2, 1);
fpSpread1.ActiveSheet.SetValue(1, 1, new DateTime(2015, 6, 15));
FarPoint.Win.Spread.CellType.NumberCellType n = new FarPoint.Win.Spread.CellType.NumberCellType();
n.DecimalPlaces = 4;
fpSpread1.ActiveSheet.Columns[2].CellType = n;
fpSpread1.ActiveSheet.SetValue(2, 2, 123.45);
fpSpread1.ActiveSheet.Columns[3].CellType = new FarPoint.Win.Spread.CellType.CheckBoxCellType();
fpSpread1.ActiveSheet.SetValue(3, 3, true);
FarPoint.Win.Spread.CellType.ComboBoxCellType c = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
c.Items = new String[] {"aaa", "bbb", "ccc"};
c.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.Index;
fpSpread1.ActiveSheet.Columns[4].CellType = c;
fpSpread1.ActiveSheet.SetValue(4, 4, 1);
}
private void button1_Click(object sender, System.EventArgs e)
{
//現在のSPREADコントロールの内容をxml形式で保存します
fpSpread1.Save("保存ファイルパス名.xml", false);
}
private void button2_Click(object sender, System.EventArgs e)
{
//保存済みxml形式をロードします
fpSpread1.Open("保存ファイルパス名.xml");
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
FpSpread1.ActiveSheet.RowCount = 5
FpSpread1.ActiveSheet.ColumnCount = 5
FpSpread1.ActiveSheet.Rows(0).BackColor = Color.LemonChiffon
FpSpread1.ActiveSheet.Rows(1).BackColor = Color.LightCyan
FpSpread1.ActiveSheet.Rows(2).BackColor = Color.LightPink
FpSpread1.ActiveSheet.Rows(3).BackColor = Color.LightGreen
FpSpread1.ActiveSheet.Rows(4).BackColor = Color.LightCoral
Dim cr As New FarPoint.Win.Spread.Model.CellRange(1, 1, 3, 3)
FpSpread1.ActiveSheet.SetOutlineBorder(cr, New FarPoint.Win.LineBorder(Color.Blue, 2))
FpSpread1.ActiveSheet.Columns(0).Font = New Font("Arial", 12, FontStyle.Bold Or FontStyle.Italic)
FpSpread1.ActiveSheet.Columns(0).ForeColor = Color.Blue
FpSpread1.ActiveSheet.Columns(0).CellType = New FarPoint.Win.Spread.CellType.TextCellType
FpSpread1.ActiveSheet.SetText(0, 0, "Excel")
FpSpread1.ActiveSheet.AddSpanCell(4, 0, 1, 2)
FpSpread1.ActiveSheet.SetText(4, 0, "SPREAD for .NET")
FpSpread1.ActiveSheet.Columns(1).CellType = New FarPoint.Win.Spread.CellType.DateTimeCellType
FpSpread1.ActiveSheet.SetColumnWidth(1, 90)
FpSpread1.ActiveSheet.AddSpanCell(1, 1, 2, 1)
FpSpread1.ActiveSheet.SetValue(1, 1, New DateTime(2015, 6, 15))
Dim n As New FarPoint.Win.Spread.CellType.NumberCellType
n.DecimalPlaces = 4
FpSpread1.ActiveSheet.Columns(2).CellType = n
FpSpread1.ActiveSheet.SetValue(2, 2, 123.45)
FpSpread1.ActiveSheet.Columns(3).CellType = New FarPoint.Win.Spread.CellType.CheckBoxCellType
FpSpread1.ActiveSheet.SetValue(3, 3, True)
Dim c As New FarPoint.Win.Spread.CellType.ComboBoxCellType
c.Items = New String() {"aaa", "bbb", "ccc"}
c.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.Index
FpSpread1.ActiveSheet.Columns(4).CellType = c
FpSpread1.ActiveSheet.SetValue(4, 4, 1)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'現在のSPREADコントロールの内容をxml形式で保存します
FpSpread1.Save("保存ファイルパス名.xml", False)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'保存済みxml形式をロードします
FpSpread1.Open("保存ファイルパス名.xml")
End Sub