zoukankan      html  css  js  c++  java
  • Silverlight 焦点疑云

    焦点,还是焦点。silverlight 在不同的Style下,竟然失去了焦点,所以,当你的界面,子窗口突然没了焦点,可以去查一查你的Style做了哪些改动。

    在作一个ChildWindow的显示时,以前使用的Style是可以在子窗口内获得键盘输入,但是为了某个效果,复制了一个stlye,去掉了一些动画效果,

    结果回来发现,键盘输入功能失效了,所有的键盘事件都不响应了。

                                    <VisualState x:Name="Open">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Overlay">
                                                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                                <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX" Storyboard.TargetName="ContentRoot">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
                                                <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.45" Value="1.05"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/-->
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY" Storyboard.TargetName="ContentRoot">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
                                                <!--SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.45" Value="1.05"/>
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>

    当时就想,要是有一个焦点的跟踪列表就好了。但是好像从古至今,没有这个东西啊。

    焦点问题在silverlight中这是一个比较困惑的问题。

    比如,控件的KeyUp,KeyDown事件,应该截获所有的键盘,但是偏偏缺省按钮的事件不能截获。

  • 相关阅读:
    Canvas 与 Image 相互转换
    oracle随笔
    QueryTask,FindTask,IdentifyTask三种查询的区别
    mysql命令
    mysql
    Delphi声明Record变量后直接初始化
    delphi实现映射和断开网络驱动器
    delphi的ArrayList
    Delphi判断一个文件是不是JPG图片
    Delphi 停靠技术的应用3(两个窗体停靠成PageControl样式, 分页停靠)
  • 原文地址:https://www.cnblogs.com/haio/p/1782274.html
Copyright © 2011-2022 走看看