private void ddToolStripMenuItem_Click(object sender, EventArgs e)
{
ss.UnitType = FPSpreadADO.UnitTypeConstants.UnitTypeTwips;
ss.set_ColWidth(2, TwipsFromPixels(1000));
}
private double TwipsFromPixels(int pixels)
{
float dpiX, dpiY;
using (Graphics g = this.CreateGraphics())
{
dpiX = g.DpiX;
dpiY = g.DpiY;
}
return ((1440 / dpiX) * pixels);
}
终于用这个方法,写出来了!!换成VB的就行了。 |