Delphi 7 中的按钮通知
我搜索了许多论坛和许多网站,但没有找到所需的解决方案。我需要显示按钮的通知数量。当表单加载时。如果通知有一百个按钮旁边应为 100。如果没有任何内容,则不应显示任何通知。
请向我建议所需的解决方案。
提前致谢。
他们要求与 IOS4 图标类似的功能。
I have searched many forums and many web sites but i didn't find the required solution.I had a requirement to show the number of notifications to buttons .When the form Loads.If the notifications are hundred there should be 100 beside the button.if nothing then no notification should be visible.
Please suggest me the required solution..
Thanks In advance.
They are asking the similar functionality as in Icons of IOS4.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您不介意为此使用组件而不是自己制作组件,那么有一个组件可以满足您的需要。它将显示状态,看起来就像您在图像链接中显示的那样。
您可以看到此页面 此处
不过它不是免费的。
If you don't mind using a component for this instead of making your own, there is one that does what you need. It will display a status and looks just like what you have shown in your image link.
You can see this page here
It is not free though.
在 iOS 4 中,有带有通知的图标(用于程序启动),但没有按钮(我认为),所以这并不完全相同,...但也许您可以创建一个自定义按钮(继承自 TButton)并使用类似的东西一个 onPaint 事件(抱歉,这太像 dotnet 风格了,...不知道在 delphi 中如何调用它)来将此“通知”绘制到按钮,就像在 TCanvas 中所做的那样。
In iOS 4 there are icons with notifications (for programm-startup) and no buttons (I think), so this is not really the same,... but maybe you can create a custom button (inherit from TButton) and use something like an onPaint Event (sorry this is too much dotnet-style,... don't know how it is called in delphi) to draw this "notification" to the button like you do it in TCanvas.
我认为您可以使用
TBalloonHint
组件。例如,要显示通知,要隐藏通知,
将如上图所示
如果要显示图像,可以使用
BalloonHint1.Images
属性。I think you can use
TBalloonHint
component. For example, To show the notification,To Hide the notification
It would be see like the above image
If you want to show images, you can use the
BalloonHint1.Images
property.您可以使用 TPaintBox 并直接绘制到其 Canvas 属性。在我看来,TCanvas 有许多方法可以使这个任务变得相当简单。只需单独存储背景图像(可能在 TImage 中),将其复制到画布(使用 OnPaint 事件中的 Draw 方法),然后绘制圆圈(Ellipse 方法)和最后的数字(TextOut 或 TextRect)。您还可以使用 TPaintBox 的 OnClick 事件来管理“按钮单击”操作。
You could use a TPaintBox and draw directly to its Canvas property. TCanvas has a number of methods that would make this a fairly simple task, in my opinion. Just store the background image separately (maybe in a TImage), copy it to the canvas (using the Draw method in the OnPaint event), and then paint the circle (Ellipse method) and the number last (TextOut or TextRect). You can also use the OnClick event of the TPaintBox to manage the "button clicking" operations.