Como puedo bloquear que el foco de un control pase al siguiente [英] Como puedo bloquear que el foco de un control pase al siguiente

查看:85
本文介绍了Como puedo bloquear que el foco de un control pase al siguiente的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ola muy buenas tardes saben estoy desarrollandounapequeñaaplicacionen wpf y una validacion sencilla lo que quiero es que cuando el control no satisfaga la validacion no se quite el foco del control por mas que el usuario haga click en otro control haci obligar que no en salga del control hasta que introdusca unos valores correctos



Esto en Windows Forms se logra atraves de el evento validating que utiliza la clase CancelEventArgs y con la intruccion e.Cancel = TRUE; pues se blokea que el foco avanse al siguiente control



el problemas es que los controles de WPF no tiene el evento验证para usar esa clase gracias porsuatención





翻译:



a非常好下午知道我正在开发一个小应用程序在WPF和一个简单的验证我想要的是,当控件不满足验证时,不要删除控件的焦点超过用户点击另一个控件强制不会离开L控件直到插入正确的值



Windows窗体中的这个是通过使用CancelEventArgs类和指令E的验证事件来实现的.Unsly = true;因为它是关注Avanse到下一个控件的blokea



问题是WPF控件没有使用该类的验证事件感谢您的关注



用CancelEventArgs更改RountedEventArgs但是我跳出错误



我尝试过:



cambiar el RountedEventArgs por el CancelEventArgs pero me bota error

Ola muy buenas tardes saben estoy desarrollando una pequeña aplicacion en wpf y una validacion sencilla lo que quiero es que cuando el control no satisfaga la validacion no se quite el foco del control por mas que el usuario haga click en otro control haci obligar que no salga del control hasta que introdusca unos valores correctos

Esto en Windows Forms se logra atraves de el evento validating que utiliza la clase CancelEventArgs y con la intruccion e.Cancel=true; pues se blokea que el foco avanse al siguiente control

el problemas es que los controles de WPF no tiene el evento Validating para usar esa clase gracias por su atención


Translation:

a very good afternoon know I'm developing a small application in WPF and a simple validation what I want is that when the control does not satisfy the validation do not remove the focus of the control by more than the user click on another control to force that does not leave L control until insert a correct values

This in Windows forms is achieved through the validating event that uses the CancelEventArgs class and with the instruction E. Cancel = true; For it is blokea that the focus Avanse to the next control

The problem is that WPF controls don't have the validating event to use that class thank you for your attention

Change the RountedEventArgs by the CancelEventArgs but I bounce error

What I have tried:

cambiar el RountedEventArgs por el CancelEventArgs pero me bota error

推荐答案

看看在这些代码项目文章中

WPF中的验证 [ ^ ]



WPF中的简单验证 [ ^ ]

D不要忘记让用户放弃,取消或退出。在用户体验方面没有比在页面中陷入困境更糟糕的事情
Have a look at these Code project articles
Validation in WPF[^]

Simple Validation in WPF[^]
Don't forget to allow the user to just give up and cancel or exit. There is nothing worse in terms of user experience than being "trapped" in a page


这篇关于Como puedo bloquear que el foco de un control pase al siguiente的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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