如何在Tabcontrol中进行Circle通知 [英] How to make Circle notificationen in Tabcontrol

查看:58
本文介绍了如何在Tabcontrol中进行Circle通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿大家



我想知道如何在TabControl中对我的标签进行圆圈通知,C#WindowsForms。



查看图片



通知人应例如,意思是在loss1和9中发生了两条新消息。在Tab2中可以看到文件



希望您理解我的问题,我可以在每个标签中找到一个圆圈圆圈中有一个数字。



美好的一天给你们所有

Hey everybody

I wonder how I can make a Circle notification of my Tabs in a TabControl, C# WindowsForms.

see image

Notificationer shall mean for example. Has happened two new messages in losses1 and 9 File is visible in Tab2

Hope you understand my question about which way I can get a circle to sit in each tab as well as have a number in the circle.

Good day to you all

推荐答案

请看我的评论问题。第二,我发现CodeProject文章解决了这个问题:画你的自己的标签 - 第二版 [ ^ ]。



对于某些圆形(非矩形)控件,这很容易。您需要做的就是提供适当的渲染,最重要的是,将属性 Control.Region 设置为合适的 System.Drawing.Region 表示非矩形形状的对象:

https://msdn.microsoft.com/en-us/library/system.windows.forms.control.region(v = vs.110)的.aspx [< a href =https://msdn.microsoft.com/en-us/library/system.windows.forms.control.region(v=vs.110).aspx\"target =_ blanktitle =New Window > ^ ],

https://msdn.microsoft.com/en-us/library/system.drawing.region(v = vs.110).aspx [ ^ ]。



这为您提供了完整的解决方案。



-SA
Please see my comment to the question. On second though, I've found CodeProject article where this problem is solved: Painting Your Own Tabs - Second Edition[^].

As to some rounded (non-rectangle) control, this is easy. All you need to do is to provide appropriate rendering and, most importantly, set the property Control.Region to suitable System.Drawing.Region object representing non-rectangular shape:
https://msdn.microsoft.com/en-us/library/system.windows.forms.control.region(v=vs.110).aspx[^],
https://msdn.microsoft.com/en-us/library/system.drawing.region(v=vs.110).aspx[^].

This gives you a complete solution.

—SA


这篇关于如何在Tabcontrol中进行Circle通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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