Files
Groupware/SubProject/FCM0000/FPUtil.cs
2018-12-22 20:59:07 +09:00

30 lines
1023 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FCM0000
{
public static class FPUtil
{
public static void ColsizeSave(FarPoint.Win.Spread.FpSpread dv, string fn)
{
arUtil.INIHelper ini = new arUtil.INIHelper(fn);
foreach (FarPoint.Win.Spread.Column col in dv.ActiveSheet.Columns)
ini.set_Data("colsize", "index_" + col.Index.ToString(), col.Width.ToString());
ini.Flush();
}
public static void ColSizeLoad(ref FarPoint.Win.Spread.FpSpread dv, string fn)
{
if (System.IO.File.Exists(fn) == false) return;
arUtil.INIHelper ini = new arUtil.INIHelper(fn);
foreach (FarPoint.Win.Spread.Column col in dv.ActiveSheet.Columns)
{
var width = ini.get_Data("colsize", "index_" + col.Index.ToString(), "0");
col.Width = float.Parse(width);
}
}
}
}