选项卡页标题图像在右侧

编程入门 行业动态 更新时间:2024-10-27 16:26:22
本文介绍了选项卡页标题图像在右侧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要在我的标签页上添加一个关闭按钮..所以我将图像添加到标签页..并在鼠标按下事件中检查其位置以关闭标签页.. 但是图像显示在选项卡页眉的左侧..我如何将其移至右侧????

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,

更多推荐

选项卡页标题图像在右侧

本文发布于:2023-10-08 10:03:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1472301.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选项卡   图像   标题

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!