找回密码
 立即注册

QQ登录

只需一步,快速开始

iceman

社区贡献组

270

主题

1万

帖子

1万

积分

社区贡献组

积分
19311

活字格认证微信认证勋章元老葡萄

iceman
社区贡献组   /  发表于:2011-12-16 17:52  /   查看:5395  /  回复:0
使用 TextBoxWatermarkCellType 实现水印功能
关于使用 TextBoxWatermarkCellType 的准备工作,请参考:
http://gcdn.grapecity.com/showtopic-2992.html

使用 Spread TextBoxWatermarkCellType 可以实现水印功能,提示用户输入,从而增强网站的体验性,下面介绍 TextBoxWatermarkCellType 的使用方法。
TextBoxWatermarkCellType 重要属性说明:
1.     CssClass  :获取或设置 Css Class 名称。
2.     Editor      :获取或设置编辑控件。
3.     Extenders:获取或设置编辑控件的扩展控件。
4.     WatermarkText:获取或设置水印文本内容。
5.     MaskedEditValidator:获取或设置输入文本校验器。
6.     WatermarkCssClass:获取或设置水印 Css Class。

下面通过实例来展示如何使用 TextBoxWatermarkCellType 实现水印功能。
1.    创建 TextBoxWatermarkCellType并设置相关属性。
a.后台代码:
  1. FarPoint.Web.Spread.Extender.TextBoxWatermarkCellType tb = new FarPoint.Web.Spread.Extender.TextBoxWatermarkCellType();
  2.             tb.WatermarkText = "Required";
  3.             tb.WatermarkCssClass = "watermarked";
  4.             FpSpread1.ActiveSheetView.Cells[0, 0].CellType = tb;
复制代码
b.前台 Css 代码:
  1. <style type="text/css">
  2.         .watermarked {
  3.                height:18px;
  4.                width:150px;
  5.                padding:2px 0 0 2px;
  6.                border:1px solid #BEBEBE;
  7.                background-color:Orange;
  8.                color:Green;
  9.                font-style:italic;
  10.             }
  11.     </style>
复制代码
c.效果图:

png

png


下面是使用:TextBoxWatermarkCellType 演示 Demo:
开 发 环 境:VS2010 + Srpead for ASP.NET V5.0.3524.2008
TextBoxWatermarkCellType.zip (2.54 MB, 下载次数: 329)

0 个回复

您需要登录后才可以回帖 登录 | 立即注册
返回顶部