/// <summary> /// スプレッドの列属性設定 列幅など /// </summary> private void setSpreadInfo() { ////行ヘッダーの列幅 //fpS1.ActiveSheet.RowHeader.Columns[0].Width = 25; //fpS1.ActiveSheet.RowHeader.Columns[0].Font = new Font("MS UI Gothic", 8); //fpS1.ActiveSheet.RowHeader.Columns[0].HorizontalAlignment = CellHorizontalAlignment.Right; ////fpS1.ActiveSheet.RowHeader.Columns[0].HorizontalAlignment = CellHorizontalAlignment.Center; //// 列の非表示設定 sample //fpS1.ActiveSheet.Columns[(int)SpreadColum.user_id].Visible = false; ////列幅,他の設定 sample //fpS1.ActiveSheet.Columns[(int)SpreadColum.user_id].Width = (float)40; //// テキスト型セル 折り返し無し //FarPoint.Win.Spread.CellType.TextCellType textcell_row = new FarPoint.Win.Spread.CellType.TextCellType(); //textcell_row.WordWrap = false; //// テキスト型セル 折り返し有り //FarPoint.Win.Spread.CellType.TextCellType textcell_rows = new FarPoint.Win.Spread.CellType.TextCellType(); //textcell_rows.Multiline = true; //改行の入力 Shift+Enterが可能となる。 シフト無しでもOKだった。確定はフォーカスを外すこと。 //textcell_rows.WordWrap = true; //textcell_rows.MaxLength = 2000; //デフォルトで切られていた為、DBの最大サイズとした。 ////小数点、桁区切りの設定 //// 0 //FarPoint.Win.Spread.CellType.NumberCellType lobjCellTypeNumberDecimalPlaces0 = new FarPoint.Win.Spread.CellType.NumberCellType(); //lobjCellTypeNumberDecimalPlaces0.DecimalPlaces = 0; //lobjCellTypeNumberDecimalPlaces0.ShowSeparator = false; //lobjCellTypeNumberDecimalPlaces0.MaximumValue = 99999999; //// 1 //FarPoint.Win.Spread.CellType.NumberCellType lobjCellTypeNumberDecimalPlaces1 = new FarPoint.Win.Spread.CellType.NumberCellType(); //lobjCellTypeNumberDecimalPlaces1.DecimalPlaces = 1; //lobjCellTypeNumberDecimalPlaces1.ShowSeparator = true; //// 2 //FarPoint.Win.Spread.CellType.NumberCellType lobjCellTypeNumberDecimalPlaces2 = new FarPoint.Win.Spread.CellType.NumberCellType(); //lobjCellTypeNumberDecimalPlaces2.DecimalPlaces = 2; //lobjCellTypeNumberDecimalPlaces2.ShowSeparator = true; ////CELL タイプの設定 //fpS1.ActiveSheet.Columns[(int)SpreadColum.user_id].CellType = (FarPoint.Win.Spread.CellType.NumberCellType)lobjCellTypeNumberDecimalPlaces0.Clone(); ////パディング設定 //fpS1.ActiveSheet.Columns[(int)SpreadColum.user_id].CellPadding.Left = (int)5; ////水平位置 //fpS1.ActiveSheet.Columns[(int)SpreadColum.user_id].HorizontalAlignment = CellHorizontalAlignment.Center; ////行の高さを設定 //int rows_count = fpS1.ActiveSheet.RowCount; //for (int i = 0; i < rows_count; i++) //{ // // 最も高さのあるテキストの高さに設定します // fpS1.ActiveSheet.Rows[i].Height = (rows_hight > fpS1.ActiveSheet.GetPreferredRowHeight(i) ? rows_hight : fpS1.ActiveSheet.GetPreferredRowHeight(i)); //} ////列を追加 //列情報の設定 : NG Spread.setSpreadColumInfo(fpS1.ActiveSheet, spread_list); //奇数行、偶数行の背景色設定 : OK Spread.SetColorAlternating(fpS1.ActiveSheet); //固定列数の設定 : +1でOK Spread.SetFrozenColumn(fpS1.ActiveSheet, (int)SpreadColum.pds_code + 1); }