DevExpress 为TextEdit设置水印文字
设置水印代码:
//设置水印值
public static void SetWatermark(this TextEdit textEdit, string watermark)
{
textEdit.Properties.NullValuePromptShowForEmptyValue = true;
textEdit.Properties.NullValuePrompt = watermark;
} //清除水印值
public static void ClearWatermark(this TextEdit textEdit)
{
if (textEdit.Properties.NullValuePromptShowForEmptyValue)
textEdit.Properties.NullValuePrompt = string.Empty;
}
调用:
private void Form1_Load(object sender, EventArgs e)
{
textEdit1.SetWatermark("请输入用户名称....");
textEdit2.SetWatermark("请输入用户密码....");
}
private void simpleButton1_Click(object sender, EventArgs e)
{
textEdit1.ClearWatermark();
textEdit2.ClearWatermark();
}
效果图:

DevExpress 为TextEdit设置水印文字的更多相关文章
- DevExpress实现为TextEdit设置水印文字
本文实例展示了DevExpress实现为TextEdit设置水印文字的方法,是一个很实用的技巧.分享给大家供大家参考. 转自 http://blog.csdn.net/yh0503/article/d ...
- DevExpress实现为TextEdit设置水印文字的方法
设置水印与消除水印 public static void SetWatermark(TextEdit textEdit, string watermark) { textEdit.Properties ...
- [WinForm]为TextBox设置水印文字
关键代码: using System; using System.Runtime.InteropServices; using System.Windows.Forms; namespace WinF ...
- TextBox 文本框水印文字
#region TextBox 文本框水印文字 /// <summary> /// 基于.NET 2.0的TextBox工具类 /// </summary> public st ...
- Java 给Word每一页设置不同文字水印效果
Word中设置水印时,可预设的文字或自定义文字设置为水印效果,但通常添加水印效果时,会对所有页面都设置成统一效果,如果需要对每一页或者某个页面设置不同的水印效果,则可以参考本文中的方法.下面,将以Ja ...
- C# 给Word每一页设置不同文字水印
Word中设置水印时,可预设的文字或自定义文字设置为水印效果,但通常添加水印效果时,会对所有页面都设置成统一效果,如果需要对每一页或者某个页面设置不同的水印效果,则可以参考本文中的方法.下面,将以C# ...
- DEVexpress GridControl 属性设置
1. 如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 2. 如何新增一条记录 (1).gridView.Ad ...
- DevExpress.XtraEditors.TextEdit 设为密码输入框
DevExpress.XtraEditors.TextEdit 设为密码输入框,解决办法: 设计窗口-->属性Properties-->Mask节点-->PasswordChar输入 ...
- php 图片加水印文字水印
/*给图片加文字水印的方法*/ $dst_path = 'http://f4.topitme.com/4/15/11/1166351597fe111154l.jpg';//保证路径正确 $dst = ...
随机推荐
- 如何使用PL/SQL Developer查看和杀掉session
http://jingyan.baidu.com/article/3ea51489eb65b152e61bba8b.html
- C++: virtual inheritance and Cross Delegation
Link1: Give an example Note: I think the Storable::Write method should also be pure virtual. http:// ...
- java中采用dom4j解析xml文件
一.前言 在最近的开发中用到了dom4j来解析xml文件,以前听说过来解析xml文件的几种标准方式:但是从来的没有应用过来,所以可以在google中搜索dmo4j解析xml文件的方式,学习一下dom4 ...
- div垂直居中的几种方法
CSS教程:div垂直居中的N种方法[转](原文地址:http://www.cnblogs.com/chuncn/archive/2008/10/09/1307321.html) 在说到这个问题的时候 ...
- POJ 2386 题解
Lake Counting 描述 Due to recent rains, water has pooled in various places in Farmer John's field, whi ...
- ZeroMQ接口函数之 :zmq_init - 初始化ZMQ环境上下文
ZeroMQ 官方地址 :http://api.zeromq.org/4-0:zmq_init zmq_init(3) ØMQ Manual - ØMQ/3.2.5 Name zmq_init - 初 ...
- [转]svn 清理失败 (cleanup 失败) 的解决方法
转载网址:http://www.tuicool.com/articles/biy6na 今天svn遇到一个头疼的问题,最开始更新的时候失败了,因为有文件被锁住了.按照以往的操作,我对父目录进行clea ...
- 使用CallableStatement的用法
package Test; import java.sql.*; public class Test7 { public static void main(String[] args) { Conne ...
- 手机版本高于xcode,xcode的快速升级
iPhone手机更新版本,xcode未更新时,不能真机测试 在xcode show in finder里面添加最新iPhone 版本 重启xcode即可 真机测试
- supervisorctl error: <class 'socket.error'>
http://stackoverflow.com/questions/18859063/supervisor-socket-error-issue supervisorctl reread error ...