场景

WinForm 应用,使用了 DevExpress.XtraEditors.TextEdit 控件的 KeyPress 和 Leave 事件。
期望在 TextEdit 上按下回车键或者当 TextEdit 失去焦点时进行相关验证并弹窗提示。

问题

弹窗显示并关闭后,TextEdit 默认是 Focused 的状态,如果这时想切换至其他模块,会触发 Leave 事件进行二次弹窗。

解决

TextEdit 没有 LostFocus 方法。
当进行第一次弹窗时,设置其他控件获取焦点,这样弹窗关闭的时候 TextEdit 就不是 Focused 的状态了。
我这里使用的是 TextEdit 所在的容器 GroupControl:GroupControlName.Focus();

[DevExpress] - 使得 XtraEditors.TextEdit 失去焦点(LostFocus)的方法的更多相关文章

  1. DevExpress实现为TextEdit设置水印文字的方法

    设置水印与消除水印 public static void SetWatermark(TextEdit textEdit, string watermark) { textEdit.Properties ...

  2. DevExpress实现为TextEdit设置水印文字

    本文实例展示了DevExpress实现为TextEdit设置水印文字的方法,是一个很实用的技巧.分享给大家供大家参考. 转自 http://blog.csdn.net/yh0503/article/d ...

  3. DevExpress.XtraEditors.TextEdit 设为密码输入框

    DevExpress.XtraEditors.TextEdit 设为密码输入框,解决办法: 设计窗口-->属性Properties-->Mask节点-->PasswordChar输入 ...

  4. Dev TreeList设置焦点失败解决方法

    问题描述 对TreeList初始化之后,设置treelist的焦点节点时,发现每次初始化控件的时不能正确的绑定焦点节点,第二次点开treelist的时候才会正常的设置目标节点为焦点节点. 截图 解决方 ...

  5. 更改DEVExpress的Column的DisplayFormat为自定义的方法。

    更改DEVExpress的Column的DisplayFormat为自定义的方法. public partial class Form1 : XtraForm { public Form1() { I ...

  6. WinForm中变Enter键为Tab键实现焦点转移的方法

    if (e.KeyCode == Keys.Enter) { //this.SelectNextControl(this.ActiveControl,true, true, true, true); ...

  7. jquery ui dialog 中使用select2 导致select2的input失去焦点的解决方法

    在jqueryUI 的dialog中使用select2,select2的input search无论怎样都获取不到焦点? 解决方法: $(document).ready(function () { $ ...

  8. DevExpress 12.1 换肤 超级简单的方法(2013-11-5版)

    本例子是按照DevExpress 12.1 版本 进行演示.请先准备好DevExpress.BonusSkins.v12.1.dll 和DevExpress.Utils.v12.1.dll 1.首先添 ...

  9. DevExpress 控件汉化代码和使用方法

    DevExpress 第三方控件汉化的全部代码和使用方法   DevExpress.XtraEditors.Controls  此控件包中包含的控件最多,包括文本框,下拉列表,按钮,等等        ...

随机推荐

  1. Consul常用接口使用

    prometheus.yml 配置 - job_name: 'node_exporter' consul_sd_configs: - server: 'consul_ip:8500' services ...

  2. [luogu 3773][CTSC 2017]吉夫特

     传送门  Solution 输入一个长度为n的数列,求有多少个长度大等于2的不上升子序列满足: \[\prod_{i=2}^{k} C(a_{b_{i-1}},a_{b_i}) mod\ 2 > ...

  3. 树莓派python 控制GPIO

    sudo pip install rpi.gpio #!/usr/bin/env python # encoding: utf-8 import RPi.GPIO as GPIO import tim ...

  4. Spring 源码学习之环境搭建

    一.下载Spring 源码 进入 https://github.com/spring-projects/spring-framework/tags 选择下载spring freamework的版本 h ...

  5. 九、postman的自带的鉴权demo

    basic authentication https://postman-echo.com/basic-auth username:postman password:password

  6. Sword cjson库函数使用

    /* cjson库的使用 */ #include <stdio.h> #include <stdlib.h> #include <string.h> #includ ...

  7. libfacedetection

    libfacedetection测试 #include <stdio.h> #include <opencv2/opencv.hpp> #include <facedet ...

  8. Linux记录-批量更改当前目录的文件后缀名

    #!/bin/bash path=. for file in $(ls $path) do if [ -f $file ] then filename=${file%.*} bak=${file#*. ...

  9. [Feature] Final pipeline: custom transformers

    有视频:https://www.youtube.com/watch?v=BFaadIqWlAg 有代码:https://github.com/jem1031/pandas-pipelines-cust ...

  10. 让pc端代码适用移动端——<meta name="viewport"

    写的代码,在pc端运行正常,在移动端就很小很小,需要放大.这时候可引入这个标签 @参考博客 用法,在<head></head>中添加<meta name="vi ...