输入事件 [英] on enter event

查看:56
本文介绍了输入事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行代码以在用户切换或单击字段时打开模式屏幕.

I'm trying to run code to open a modal screen when the user tabs or clicks into a field.

在使用begininvoke和 INotifyPropertyChanged.p ropertyChanged

I have similar even cose working when a field value is changed usign the begininvoke and INotifyPropertyChanged.propertyChanged

代码,因此需要类似的代码来输入"而不是更改"

code, so need similar code for "enter" rather than "change"

这是我的更改代码:

        Private Sub UserParameters_SelectionChanged()
            ' catches the field that has the focus on the screen 

            Dim selectedItem = Me.UserParameters.SelectedItem
            If (selectedItem Is Nothing) Then Return

            Microsoft.LightSwitch.Threading.Dispatchers.Main.BeginInvoke _
                (
                Sub()
                    RemoveHandler DirectCast(selectedItem, INotifyPropertyChanged).PropertyChanged _
                        , AddressOf PropertyChanged
                    AddHandler DirectCast(selectedItem, INotifyPropertyChanged).PropertyChanged _
                        , AddressOf PropertyChanged
                End Sub
                )
        End Sub

        Private Sub PropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs)
            'ShowMessageBox("param 7 from within change = " & clsCommonfunctions.fncParamDate(7, "-All-", "err"))

            Select Case e.PropertyName
                Case "CurrentUserValue"
                    If Me.UserParameters.SelectedItem.CurrentUserValue = "" Then
                        entityWindow.AddEntity()
                    Else
                        entityWindow.ViewEntity()
                    End If

            End Select

        End Sub

谢谢

赠予

推荐答案

我只能说这是一个非常""的问题;想法是当有人进入或单击控件时弹出模式窗口.这将非常"震撼".用户的体验.
All I can say is that it's a very "bad" idea to be popping up modal windows when someone enters, or clicks into, a control. It would be very "jarring" experience for the users.


这篇关于输入事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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