Windows应用程序不遵循页面设置中的顶部和底部页边距 [英] The Top and bottom margins in Page Setup are not followed in Windows application

查看:78
本文介绍了Windows应用程序不遵循页面设置中的顶部和底部页边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面顶部和底部的页边距不遵循我在页面设置"对话框中输入的内容.左边距,右边距都可以,但是顶部,底部边距到处都是.
在此先感谢您的帮助.我正在使用Visual Studio工具箱中的页面设置工具.

这个可以了.
MypageSetupDialog.PageSettings.Margins =新的Margins(40,40,40,40);

但是当我换成这个
MypageSetupDialog.PageSettings.Margins =新的Margins(100,100,100,100);
底部边距超过1英寸.

My page margins top and bottom dont follow what I entered in Page Setup dialogue box. The left, right margins are ok, but the top, bottom margins are all over the place.
Thanks in advance for your help. I am using the page setup tool from the visual studio toolbox.

This one works ok.
MypageSetupDialog.PageSettings.Margins = new Margins(40, 40, 40, 40);

But when I change to this
MypageSetupDialog.PageSettings.Margins = new Margins(100, 100, 100, 100);
The bottom margin is more than 1 inch.

推荐答案



您可以检查页面长度是否适合您的打印材料(PM)?如果PM长度小于或大于用于打印的页面大小,则会导致此问题.
Hi,

You can check that does the page Length fit to your printing material (PM)? PM length causes this problem, if it is much smaller or bigger than page size used to print.


//在DrawRows方法中,这是检查页面结尾的代码

//检查CurrentY是否超出页面边界
//如果是这样,则退出该函数并返回true表示另一个
//必须执行PagePrint操作
如果((int)CurrentY>(PageHeight-TopMargin-BottomMargin))
{
CurrentRow ++;
返回true;
}

//应该是
如果((int)CurrentY>(PageHeight-BottomMargin))
////否则底边距将加倍(如果与顶边距相同)
//In the DrawRows method here is the code that checks for end of page

// Checking if the CurrentY is exceeds the page boundries
// If so then exit the function and returning true meaning another
// PagePrint action is required
if ((int)CurrentY > (PageHeight - TopMargin - BottomMargin))
{
CurrentRow++;
return true;
}

//should be
if ((int)CurrentY > (PageHeight - BottomMargin))
// otherwise the bottom margin is doubled (if the same as top margin)


这篇关于Windows应用程序不遵循页面设置中的顶部和底部页边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆