[问题2]: 我现在用Process打印多个文件,在打之前,我把多个文件都取出来放到本地,循环用Process来进行打印,发现一个问题,比如我传了20个文件进去,结果发现丢了一些文件,尤其在内存/CPU占用比较厉害的时候容易发生丢失现象。 请高手帮忙! 附方法: public void PrintDoc(string filename) { Process process = new Process(); try { process.StartInfo.UseShellExecute = true; process.StartInfo.FileName = filename; process.StartInfo.Verb = "Print"; process.StartInfo.CreateNoWindow = true; process.StartInfo.WindowStyle = ProcessWindowStyle.Minimized; process.Start(); } catch (Win32Exception ex) { if (ex.NativeErrorCode == ERROR_FILE_NOT_FOUND ) { throw new Exception("File not found in your personal folder.") ; } if (ex.NativeErrorCode == ERROR_ACCESS_DENIED ) { throw new Exception("You do not have permission to print this file."); } } }
Dim RowHeight As Integer '行高 Dim DataGridHeight As Integer '网格的总高度 Dim Rows As Integer '计算出来的行数 Dim X As Integer '显示行以外的自己慢慢调吧 DataGridView1.AllowUserToResizeRows = False RowHeight = DataGridView1.CurrentCell.OwningRow.Height DataGridHeight = DataGridView1.Bounds.Height Rows = (DataGridHeight - X) / RowHeight
我现在用Process打印多个文件,在打之前,我把多个文件都取出来放到本地,循环用Process来进行打印,发现一个问题,比如我传了20个文件进去,结果发现丢了一些文件,尤其在内存/CPU占用比较厉害的时候容易发生丢失现象。
请高手帮忙!
附方法:
public void PrintDoc(string filename)
{
Process process = new Process();
try
{
process.StartInfo.UseShellExecute = true;
process.StartInfo.FileName = filename;
process.StartInfo.Verb = "Print";
process.StartInfo.CreateNoWindow = true;
process.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
process.Start();
}
catch (Win32Exception ex)
{
if (ex.NativeErrorCode == ERROR_FILE_NOT_FOUND )
{
throw new Exception("File not found in your personal folder.") ;
}
if (ex.NativeErrorCode == ERROR_ACCESS_DENIED )
{
throw new Exception("You do not have permission to print this file.");
}
}
}
不好意思,表达是有点问题。
比如我要打开一个窗体,需要显示大量数据,我就手动做分页处理,每次要刚好显示满(不要出现滚动条,且不要剩余超过两条记录的宽度)。我该如何实现呢?
因为这个窗体大小是全屏,随着客户端显示器的大小发生变化。
Dim DataGridHeight As Integer '网格的总高度
Dim Rows As Integer '计算出来的行数
Dim X As Integer '显示行以外的自己慢慢调吧
DataGridView1.AllowUserToResizeRows = False
RowHeight = DataGridView1.CurrentCell.OwningRow.Height
DataGridHeight = DataGridView1.Bounds.Height
Rows = (DataGridHeight - X) / RowHeight
我是用Listview,不是用DataGrid,谢谢。
另外,用Acrobat5.0就不会,升级为Acrobat7.0后就出现这个问题了。
不知是哪儿的问题。望高手出来帮忙!!
欢迎各位提供思路或资料,多谢!
搜一下有很多处理分页的存储过程 效率挺高的
那最大行数怎么求啊?这个才是问题所在。
我可以通过ClientSize来获取客户端listview的实际大小,如何根据客户端字体大小来求可显示的最大行数呢?
否则,客户端太丑了。奇怪,listview控件怎么不加分页功能呢?就是做起来也费事得要死。