本文介绍了选项卡页标题图像在右侧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在我的标签页上添加一个关闭按钮..所以我将图像添加到标签页..并在鼠标按下事件中检查其位置以关闭标签页.. 但是图像显示在选项卡页眉的左侧..我如何将其移至右侧????
I need to add a close button on my tabpages.. so i add image to the tabpage..and check its position in the mouse down event for closing the tabpage.. but the image appears on the left side of tabpage header.. how can i move it to the right????
推荐答案有一种方法可以将图像向右移动.您必须添加选项卡页面的绘画事件 并获取图形指针. msdn.microsoft/en-us/library/system.windows.forms.control.onpaint.aspx [ ^ ] Hi, There is a way to move the image to the right. You have to add Paint Event of tab page and get the graphics pointer. msdn.microsoft/en-us/library/system.windows.forms.control.onpaint.aspx[^] Graphics g = e.Graphics. g.DrawImage(TestImage, new Rectangle(xDraw, yDraw, TestImageWidth, TestImageHeight));
xDraw和yDraw将使您向右移动图像的偏移量. 亲切的问候,
xDraw, and yDraw will get you the offset to move the image to the right. Kind regards,
更多推荐
选项卡页标题图像在右侧
发布评论