zoukankan      html  css  js  c++  java
  • Silverlight的Tooltip当控件Disable时不显示的问题

    在WPF中有ToolTipService.ShowOnDisabled="True"这样的附加属性可以完成这个实现
    可是在下面两篇提问中可以发现silverlight中缺乏这样的实现
    http://silverlight.net/forums/t/52753.aspx
    https://silverlight.net/forums/p/119934/270379.aspx
    但是这个对用户体验又是极其重要的,codeplex上有个扩展tooltipservice的项目,可是也并未涉及到这个问题
    http://tooltipservice.codeplex.com/

    例如 xaml
    Code

    code-behind
    Code

    这样当点击了按钮时是不会再显示tooltip了

    有一种不怎么有美感的解决方式就是,在要显示tooltip的控件上加一个透明的rectangle,然后在这个rectangle上放置原来要在控件上放的tooltip
    这样确实可以显示了
                    <Grid>
                        
    <Grid.ColumnDefinitions>
                            
    <ColumnDefinition Width="*"></ColumnDefinition>
                        
    </Grid.ColumnDefinitions>
                        
    <Grid.RowDefinitions>
                            
    <RowDefinition Height="*"></RowDefinition>
                        
    </Grid.RowDefinitions>
                        
    <Button Grid.Row="0" Grid.Column="0" x:Name="testButton" Content="test" IsEnabled="False" >
                        
                        
    </Button>
                        
    <Rectangle Fill="Transparent" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ToolTipService.ToolTip="test">
                            
                        
    </Rectangle>
                    
    </Grid>
    还有没有什么更好的解决方案呢?

  • 相关阅读:
    RS-232 vs. TTL Serial Communication(转载)
    UART to Serial Terminal(转载)
    UART Explained(转载)
    Gprinter热敏打印机光栅位图点阵数据解析工具
    WinCE非通用调试工具汇总
    WinCE下GPRS自动拨号软件(GPRS AutoDial)
    WinCE项目应用之车载导航
    mysql创建临时表,将查询结果插入已有的表
    mysql利用navicat导出表结构和表中数据
    mysql查看表的属性 mysql将查询结果给临时变量
  • 原文地址:https://www.cnblogs.com/ueqtxu/p/1554292.html
Copyright © 2011-2022 走看看