当前位置: 移动技术网 > IT编程>开发语言>.net > WPF-004 控件 ToolTip

WPF-004 控件 ToolTip

2018年12月07日  | 移动技术网IT编程  | 我要评论

永利娱乐注册-上055118,佐樱h文,鸡蛋美容祛斑方法

wpf中的工具提示(鼠标放在某个控件上弹出的那个东东)用法很简单。

1、复杂的工具提示

不光有文字还有图片什么的,只需要使用tooltip属性,给该属性中加控件就可以了。如下,

 [html]  

<!--复杂的工具提示-->  

        <button height="25" content="提示工具演示" horizontalalignment="center">  

            <button.tooltip>  

                <tooltip background="#60aa4030" foreground="white" hasdropshadow="false"  

                          placement="mouse">  

                    <stackpanel>  

                        <textblock margin="3">提示语:这是什么?</textblock>  

                        <image source="image/kengdiede12306.jpg" stretch="fill"/>  

                        <textblock margin="3">传说中的3亿网站。</textblock>  

                    </stackpanel>  

                </tooltip>  

            </button.tooltip>  

        </button>  

 

<!--复杂的工具提示-->

        <button height="25" content="提示工具演示" horizontalalignment="center">

            <button.tooltip>

                <tooltip background="#60aa4030" foreground="white" hasdropshadow="false"

                          placement="mouse">

                    <stackpanel>

                        <textblock margin="3">提示语:这是什么?</textblock>

                        <image source="image/kengdiede12306.jpg" stretch="fill"/>

                        <textblock margin="3">传说中的3亿网站。</textblock>

                    </stackpanel>

                </tooltip>

            </button.tooltip>

        </button>效果:\

 

至于修改提示的位置,一般修改placement属性。

2、纯文本的提示

这个就不需要加控件了,直接写在tooltip属性里了。

 

 

[html]  

<button width="200"  height="50" content="tooltip属性演示" grid.row="2"  

        tooltip="纯文本tolltip就用这个啦。" horizontalalignment="center">  

</button>  

 

        <button width="200"  height="50" content="tooltip属性演示" grid.row="2"

                tooltip="纯文本tolltip就用这个啦。" horizontalalignment="center">

        </button>效果:

\

3、不能使用tooltip属性的

如果有控件没有tooltip属性,那么就用tooltipservice属性了。

 

[html]  

<button width="200" height="50" grid.row="1" content="tooltipservice演示"  

        horizontalalignment="center" tooltipservice.initialshowdelay="1"  

        tooltipservice.tooltip="tooltipservice">  

</button>  

 

        <button width="200" height="50" grid.row="1" content="tooltipservice演示"

                horizontalalignment="center" tooltipservice.initialshowdelay="1"

                tooltipservice.tooltip="tooltipservice">

        </button>效果:

 

\

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网