如何使用图像创建自定义工具提示? [英] How to create a custom ToolTip with an image?

查看:64
本文介绍了如何使用图像创建自定义工具提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个包含以下内容的自定义工具提示:

I want to create a custome tooltip with the folllowing contents:

  • 右上角的图片
  • 左侧的文字

目前,我有一个继承自ToolTip Objekt的类.

Currently I have a class who inherits from the ToolTip Objekt.

class CustomToolTip : ToolTip
{
    public CustomToolTip()
    {
        this.OwnerDraw = true;
        this.Popup += new PopupEventHandler(this.OnPopup);
        this.Draw += new DrawToolTipEventHandler(this.OnDraw);
    }

    private void OnPopup(object sender, PopupEventArgs e)
    {
        e.ToolTipSize = new Size(200, 100);
    }

    private void OnDraw(object sender, DrawToolTipEventArgs e)
    {

    }
}

但是我不知道如何在"OnDraw事件"中显示带有文本的图像.

But I don't know what to do in the "OnDraw-Event" to show a Image with text.

谢谢您的帮助

推荐答案

请尝试

这篇关于如何使用图像创建自定义工具提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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