private void Form1_Load(object sender, System.EventArgs e)
{
fpSpread1.ActiveSheet.ColumnCount = 5;
fpSpread1.ActiveSheet.RowCount = 6;
fpSpread1.ActiveSheet.DefaultStyle.CellType = new FarPoint.Win.Spread.CellType.NumberCellType();
for (int i = 0; i <= fpSpread1.ActiveSheet.RowCount -1 ; i++)
{
for (int j = 0; j <= fpSpread1.ActiveSheet.ColumnCount -1 ; j++)
{
fpSpread1.ActiveSheet.SetValue(i, j, i + j);
}
}
}
private void button1_Click(object sender, System.EventArgs e)
{
//印刷プレビュー画面を表示します
fpSpread1.ActiveSheet.PrintInfo.Preview = true;
//アクティブシート印刷します
fpSpread1.PrintSheet(fpSpread1.ActiveSheet);
}
private void button2_Click(object sender, System.EventArgs e)
{
//PrintPreviewDialogのインスタンスを生成し、各プロパティを変更します
PrintPreviewDialog pi = new PrintPreviewDialog();
pi.Text = "カスタマイズされたプレビュー画面";
ToolStrip ts = (ToolStrip)pi.Controls[1];
ts.BackColor = Color.LemonChiffon;
ts.ForeColor = Color.Blue;
ts.Items[0].Visible = false;
ts.Items[1].Text = "拡大/縮小";
ts.Items[1].TextAlign = ContentAlignment.BottomCenter;
ts.Items[3].Visible = false;
ts.Items[4].Visible = false;
ts.Items[5].Visible = false;
ts.Items[9].Text = "終わり";
ts.Items[9].BackColor = Color.Cyan;
ts.Items[11].Text = "頁";
//カスタマイズされたPrintPreviewDialogを設定します
fpSpread1.SetPrintPreview(pi);
//印刷プレビュー画面を表示します
fpSpread1.ActiveSheet.PrintInfo.Preview = true;
//アクティブシート印刷します
fpSpread1.PrintSheet(fpSpread1.ActiveSheet);
}
private void fpSpread1_PrintPreviewShowing(object sender, FarPoint.Win.Spread.PrintPreviewShowingEventArgs e)
{
//表示倍率75%で印刷プレビュー画面を表示します
e.PreviewControl.Zoom = 0.75;
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
FpSpread1.ActiveSheet.ColumnCount = 5
FpSpread1.ActiveSheet.RowCount = 6
FpSpread1.ActiveSheet.DefaultStyle.CellType = New FarPoint.Win.Spread.CellType.NumberCellType
For i As Integer = 0 To FpSpread1.ActiveSheet.RowCount - 1
For j As Integer = 0 To FpSpread1.ActiveSheet.ColumnCount - 1
FpSpread1.ActiveSheet.SetValue(i, j, i + j)
Next
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'印刷プレビュー画面を表示します
FpSpread1.ActiveSheet.PrintInfo.Preview = True
'アクティブシート印刷します
FpSpread1.PrintSheet(FpSpread1.ActiveSheet)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'PrintPreviewDialogのインスタンスを生成し、各プロパティを変更します
Dim pi As New PrintPreviewDialog
pi.Text = "カスタマイズされたプレビュー画面"
Dim ts As ToolStrip = pi.Controls(1)
ts.BackColor = Color.LemonChiffon
ts.ForeColor = Color.Blue
ts.Items(0).Visible = False
ts.Items(1).Text = "拡大/縮小"
ts.Items(1).TextAlign = ContentAlignment.BottomCenter
ts.Items(3).Visible = False
ts.Items(4).Visible = False
ts.Items(5).Visible = False
ts.Items(9).Text = "終わり"
ts.Items(9).BackColor = Color.Cyan
ts.Items(11).Text = "頁"
'カスタマイズされたPrintPreviewDialogを設定します
FpSpread1.SetPrintPreview(pi)
'印刷プレビュー画面を表示します
FpSpread1.ActiveSheet.PrintInfo.Preview = True
'アクティブシート印刷します
FpSpread1.PrintSheet(FpSpread1.ActiveSheet)
End Sub
Private Sub FpSpread1_PrintPreviewShowing(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.PrintPreviewShowingEventArgs) Handles FpSpread1.PrintPreviewShowing
'表示倍率75%で印刷プレビュー画面を表示します
e.PreviewControl.Zoom = 0.75
End Sub