MESCIUS SPREAD for Windows Forms 15.0J サンプルコード集 > 印刷 > 指定したシートを印刷する |
FpSpreadクラスのPrintSheetメソッド呼び出しによって対象シートを印刷できます。
|
private void Form1_Load(object sender, System.EventArgs e) { fpSpread1.ActiveSheet.Cells[2, 2].CellType = new FarPoint.Win.Spread.CellType.TextCellType(); fpSpread1.ActiveSheet.SetText(2, 2, "Print"); } private void button1_Click(object sender, System.EventArgs e) { //印刷プレビュー画面を表示します fpSpread1.ActiveSheet.PrintInfo.Preview = true; //アクティブシート印刷します fpSpread1.PrintSheet(fpSpread1.ActiveSheet); }
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load FpSpread1.ActiveSheet.Cells(2, 2).CellType = New FarPoint.Win.Spread.CellType.TextCellType FpSpread1.ActiveSheet.SetText(2, 2, "Print") 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