locked
tooltip中添加button RRS feed

  • Question

  • 我想在一个tooltip中添加一个button,点击这个button时触发某个事件。

    I want to put a button on tooltip, and i expect an event to be occured when i click it.

    代码如下:

    The code is shown below:

                   

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
            <Button Content="tooltip" Height="50" Width="100"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    PointerExited="Button_PointerExited">
                <ToolTipService.ToolTip>
                    <ToolTip x:Name="tooltip" Closed="tooltip_Closed"  >
                        <Button Height="80" Width="100"
                        RequestedTheme="Light"
                        Click="Button_Click"
                        Content="tooltip"/>
                    </ToolTip>

                </ToolTipService.ToolTip>
            </Button>

                </Grid>

    但是这个tooltip中的button好像不可用,谁能帮忙解决一下吗?

    But this button on the tooltip seems to be unavailable, who can help me with it?

    tooltip中可以添加这些控件吗?

    Could i put these controls on tooltip?


    Thursday, August 15, 2013 3:29 PM

Answers

  • Hi Shirley,

    This is an English language forum. If you would like to post in Chinese then please post in the

    Chinese language forums.

    这里是英文论坛。如果你想用中文来表达你遇到的问题,请将帖子发在中文论坛。

    Putting a button (or other interactive control) on a tooltip isn't a good idea. Tooltips go away when the mouse moves, so they are not appropriate for interaction. Instead you can use a Popup control and handle the interaction yourself.

    See the Guidelines and checklist for tooltips .

    --Rob

    将一个按钮(或者类似的交互控件)放置在tooltip上并不是一个好主意。他们所触发的事件会互相影响,所以这样的设计不利于与使用者进行交互。你应该使用Popup 控件来代替它,并自己定制交互规则。

    请参考Guidelines and checklist for tooltips。

    英语语言论坛如果中国发布然后张贴汉语语言论坛
    按钮 (或其他交互式控件) 一个工具提示不是一个主意工具提示消失鼠标移动所以他们合适互动相反可以使用弹出式菜单控制自己处理交互
    请参阅准则清单工具提示


    Thursday, August 15, 2013 8:00 PM
    Moderator

All replies

  • Hi Shirley,

    This is an English language forum. If you would like to post in Chinese then please post in the

    Chinese language forums.

    这里是英文论坛。如果你想用中文来表达你遇到的问题,请将帖子发在中文论坛。

    Putting a button (or other interactive control) on a tooltip isn't a good idea. Tooltips go away when the mouse moves, so they are not appropriate for interaction. Instead you can use a Popup control and handle the interaction yourself.

    See the Guidelines and checklist for tooltips .

    --Rob

    将一个按钮(或者类似的交互控件)放置在tooltip上并不是一个好主意。他们所触发的事件会互相影响,所以这样的设计不利于与使用者进行交互。你应该使用Popup 控件来代替它,并自己定制交互规则。

    请参考Guidelines and checklist for tooltips。

    英语语言论坛如果中国发布然后张贴汉语语言论坛
    按钮 (或其他交互式控件) 一个工具提示不是一个主意工具提示消失鼠标移动所以他们合适互动相反可以使用弹出式菜单控制自己处理交互
    请参阅准则清单工具提示


    Thursday, August 15, 2013 8:00 PM
    Moderator
  • Thanks for your help.

    I will pay attention to this.

    Friday, August 16, 2013 1:16 AM