如何保存无边框的表格控制箱 [英] How to save form without border & controlbox
本文介绍了如何保存无边框的表格控制箱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的.
我有一个表单,其中包含一些内容,希望允许我的用户另存为位图或jpeg.我有一个保存"按钮,当用户单击它时,它想为该表单内容(没有边框和控制箱)拍摄快照,并打开保存文件"对话框,使用户可以决定要保存文件的位置. br/>
请说明您的解决方案,这是C#中的新增功能.
Hi dears.
I have a form that with some content that I want to allow my users to save as a bitmap or jpeg. I have a Save button that when the user clicks it, like to take a snapshot of that form content (without border and controlbox) and have a Save File Dialog open up that allows the user to decide where they want to save the file.
Please explain your solution,i''m new in C#.
推荐答案
将 border设置为0 和 ControBox设置为False怎么办? 在保存之前.保存后,将 border设置为1 ,将 ControlBox设置为True .我以为你是Windows窗体开发人员.
希望对您有所帮助.
What about Set border to 0 and ControBox to False just before save it. Set border to 1 and ControlBox to True after saved it. I assumed that you''re windows forms developer.
Hope it helps.
我遇到了同样的问题.这是我做的事情:
1)将所有内容放入面板中
2)使用代码:
I had the same problem.Here is what I did:
1)Put Everything inside a panel
2)Use Code:
private void SaveToImage(string FilePath)
{
Bitmap a = new Bitmap(panel1.Width, panel1.Height);
panel1.DrawToBitmap(a, new Rectangle(0, 0, panel1.Width, panel1.Height));
a.Save(FilePath);
}
这篇关于如何保存无边框的表格控制箱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文