wpf中的自定义工具提示 [英] Customized tool tips in wpf

查看:95
本文介绍了wpf中的自定义工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在开发wpf应用程序。我为我的应用程序完成了自定义工具提示。现在,当我将光标放在任何按钮或文本框上时,我在窗口的某个固定位置显示工具提示...现在,当光标放在窗口的任何位置时,我想放置一个工具提示..所以我的用户通过查看工具提示中的描述获取有关该窗口功能的信息...当我的光标放在wpf中的窗口屏幕内时,任何人都可以提示我如何放置工具提示

Hello,
i am working on wpf application. I have done customized tool tips for my application. Right now when I place my cursor on any button or text box I am displaying a tooltip at some fixed location in my window... Now I wan to place a tool tip when my cursor is placed any where in the window.. So that my user gets the info about functionality of that window by seeing description in tool tip... Can any one sugest me how to place a tool tip when my cursor is placed inside the window screen in wpf

推荐答案

你是如何实现自定义工具提示的?



工具提示的WPF标准行为,即使是自定义工具提示,它出现在旁边光标,如本例所示;

How have you implemented your custom tool tips?

WPF standard behaviour for tooltips, even customized ones, is that it appears next to the cursor, as in this example;
<Window x:Class="WpfApplication4.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        Title="MainWindow" Height="350" Width="525">
    <StackPanel>
        <Button Content="A" ToolTip="Simple"></Button>
        <Button Content="B">
            <Button.ToolTip>
                <Grid Width="100" Height="100" Background="DeepPink">
                    <Label Content="I am not simple"/>
                </Grid>
            </Button.ToolTip>
        </Button>
    </StackPanel>
</Window>





除非您的工具提示需要一些非常特殊的处理,否则您应该可以使用该类型的建设。



希望这会有所帮助,

Fredrik



Unless your tooltips require some very special treatment, you should be able to do customized versions using that type of construct.

Hope this helps,
Fredrik


这篇关于wpf中的自定义工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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