在键盘上点击一下Pring按钮,然后找个画图软件粘贴一下就可以了
解决方案 »
- ihtmlelement模拟点击的问题
- 怎么禁止别人调用我的程序
- Excel读取问题
- 一个关于数据库的check 约束问题
- 中了木马后,硬盘里的所有的网页文件都加了了<iframe>...</iframe>,如何才能删除?
- magicajax一个难解问题,请高手指教
- 英雄比武大会来了,你准备好了吗?
- 买了新电脑桌,连书架的。散...
- 关于面向对象的一些指导性原则(开放-封闭原则(OCP)、Liskov替换原则(LSP)、依赖倒转原则(ISP)等)
- 急问???如何读取D:\2\2.txt文件,并将第一行数据写入本vc#项目文件夹内文件中e:\vc#项目文件夹\3.txt
- 小问题!!!!!!!!
- 数据库访问问题!急急
可以使用硬拷贝的办法DrawString
DrawLine等函数实现知道位置后就可以在相应的position画简单的线和文字组成
{
g.FillRectangle(new SolidBrush(this.BackColor), 0, 0, this.Width, this.Height);
float scale = resX/ScreenResolution;
// Cycle through each control on the form and paint it to the printe
foreach (Control c in Controls)
{// Get the time of the next control so we can unbox it
string strType = c.GetType().ToString().Substring(c.GetType().ToString().LastIndexOf(".") + 1);
switch (strType)
{
case "Button":
Button b = (Button)c;// Use the ControlPaint method DrawButton in order to draw the button of the form
ControlPaint.DrawButton(g, ((Button)c).Left, ((Button)c).Top, ((Button)c).Width, ((Button)c).Height, ButtonState.Normal);// We also need to draw the text
g.DrawString(b.Text, b.Font, new SolidBrush(b.ForeColor),
b.Left + b.Width/2 - g.MeasureString(b.Text,
b.Font).Width/2, b.Top + b.Height/2 - g.MeasureString("a", b.Font).Height/2,
new StringFormat());break;case "TextBox":TextBox t = (TextBox)c;// Draw a text box by drawing a pushed in button and filling the rectangle with the background color and the text
// of the TextBox control// First the sunken border
ControlPaint.DrawButton(g, t.Left, t.Top, t.Width, t.Height, ButtonState.Pushed );// Then fill it with the background of the textbox
g.FillRectangle(new SolidBrush(t.BackColor), t.Left+1, t.Top + 1, t.Width+2, t.Height -2);// Finally draw the string inside
g.DrawString(t.Text, t.Font, new SolidBrush(t.ForeColor), t.Left + 2,
t.Top + t.Height/2 - g.MeasureString("a", t.Font).Height/2, new StringFormat());break;case "CheckBox":// We have a checkbox to paint, unbox it CheckBox cb = (CheckBox)c;// Use the DrawCheckBox command to draw a checkbox and pass the button state to paint it checked or unchecked
if (cb.Checked)
ControlPaint.DrawCheckBox(g, cb.Left, cb.Top, cb.Height/2, cb.Height/2, ButtonState.Checked);
else
ControlPaint.DrawCheckBox(g, cb.Left, cb.Top, cb.Height/2, cb.Height/2, ButtonState.Normal);// Don't forget the checkbox text
g.DrawString(cb.Text, cb.Font, new SolidBrush(cb.ForeColor), cb.Right -cb.Height - g.MeasureString(cb.Text, cb.Font).Width ,
cb.Top, new StringFormat()); break; }
}}