Font font=new Font("Arial",9); Graphics grap=this.CreateGraphics(); context=ds.Tables[0].Rows[j][i].ToString(); sizef=grap.MeasureString(context,font);
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms;SizeF sizef=new SizeF(); Font font=new Font("Arial",9); Graphics grap=this.CreateGraphics();sizef=grap.MeasureString("测试用12345ABC",font); int len=sizef.Width;
To whmjw(找工作中) : 在WEBFORM中以下这一行编译不能通过 Graphics grap=this.CreateGraphics(); this中根本没有此CreateGraphics事件。
乘以字符数
Graphics grap=this.CreateGraphics();
context=ds.Tables[0].Rows[j][i].ToString();
sizef=grap.MeasureString(context,font);
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;SizeF sizef=new SizeF();
Font font=new Font("Arial",9);
Graphics grap=this.CreateGraphics();sizef=grap.MeasureString("测试用12345ABC",font);
int len=sizef.Width;
在WEBFORM中以下这一行编译不能通过
Graphics grap=this.CreateGraphics();
this中根本没有此CreateGraphics事件。