TX Textcontrol 使用总结六——常用属性设置
1.字体设置
Tx textcontrol字体设置以版本22为例,直接设置FontSize =int,字体大小将小于正常其他控件字体设置。应做如下处理(仅供参考)
this.textControl1.Selection.FontSize = 10 * 20;
/// <summary>
/// 设置TextControl字体
/// </summary>
/// <param name="txcontrol">TextControl txcontrol</param>
/// <param name="font">字体</param>
/// <param name="foreColor">字体颜色</param>
public void SetTxFont(TextControl txcontrol, System.Drawing.Font font, Color foreColor)
{
txcontrol.ForeColor = foreColor;
txcontrol.Font = font;
}
/// <summary>
/// 设置TextControl中Text内容指定的内容的颜色(整个TX)
/// </summary>
/// <param name="txcontrol">TextControl txcontrol</param>
/// <param name="listKey">需要变更颜色的内容</param>
private void SetSpecialStyle(TextControl txcontrol, List<string> listKey)
{
int index = -1;
int count = listKey.Count;
int start = txcontrol.Selection.Start;
for (int i = 0; i < count; i++)
{
do
{
index = txcontrol.Find(listKey[i], index + 1, TXTextControl.FindOptions.NoMessageBox);
txcontrol.Selection.ForeColor = Color.Red;
} while (index != -1);
}
txcontrol.Select(start, 0);
}
2.ViewMode编辑模式
PageView、Normal、FloatingText、Simplecontrol一般使用比较多的为PageView或者Normal.
如下:
/// <summary>
/// 设置TextControl的ViewMode以及是否可用
/// </summary>
/// <param name="control">TextControl control</param>
/// <param name="mode">ViewMode mode</param>
/// <param name="enabled">true/false</param>
public void SetTextControlViewMode(TextControl control, ViewMode mode, bool enabled)
{
control.Enabled = enabled;
control.ViewMode = mode;
if (!enabled) control.Text = string.Empty;
}
3.EditMode
Edit——可编辑
ReadAndSelect——可选择,不可编辑
ReadOnly——只读
4.设置Tx control中表格是否显示网格
/// <summary>
/// 设置Tx TextControl 表格控件是否显示网格
/// </summary>
/// <param name="txcontrol">TextControl txcontrol</param>
/// <param name="isGridLines">true/false</param>
public void SetTxTableStyle(TextControl txcontrol, bool isGridLines)
{
txcontrol.Tables.GridLines = isGridLines;
}
TX Textcontrol 使用总结六——常用属性设置的更多相关文章
- unigui的ServerModule常用属性设置
unigui的ServerModule常用属性设置 1)压缩设置 compression是压缩数据用的.默认启用压缩,且压缩级别是最大的. 2)UNIGUI运行时库设置 UNIGUI需要4个运行时库, ...
- Android中TextView和EditView常用属性设置
Android中TextView和EditView常用属性设置 点击跳转
- DEV控件:gridControl常用属性设置(转载)
特别长,先撸下来再说 1.隐藏最上面的GroupPanel gridView1.OptionsView.ShowGroupPanel=false; 2.得到当前选定记录某字段的值 sValue=T ...
- DEV控件:gridControl常用属性设置
1.隐藏最上面的GroupPanel gridView1.OptionsView.ShowGroupPanel=false; 2.得到当前选定记录某字段的值 sValue=Table.Rows[g ...
- DEV控件GridControl常用属性设置
1. 如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 2. 如何新增一条记录 (1).gridView.Ad ...
- DEV控件GridControl常用属性设置(转)
1. 如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 2. 如何新增一条记录 (1).gridView. ...
- 【iOS】UILabel 常用属性设置
UILabel 的一些常用属性,示例代码如下: // 字体大小 label.font = [UIFont systemFontOfSize:14.0]; label.font = [UIFont fo ...
- DevExpress的TreeList的常用属性设置以及常用事件
场景 Winform控件-DevExpress18下载安装注册以及在VS中使用: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/1 ...
- JFrame常用属性设置模板
最近在学习Swing,在各种demo中都需要构建JFrame,于是我决定把构建JFrame的代码贴上来,以后就直接复制粘贴了. public static void main(String[] arg ...
随机推荐
- 转载几篇关于GNU autotools的文章
http://www.laruence.com/2009/11/18/1154.html http://www.ibm.com/developerworks/cn/linux/l-makefile/ ...
- 递归神经网络(RNN)简介(转载)
在此之前,我们已经学习了前馈网络的两种结构--多层感知器和卷积神经网络,这两种结构有一个特点,就是假设输入是一个独立的没有上下文联系的单位,比如输入是一张图片,网络识别是狗还是猫.但是对于一些有明显的 ...
- SQL注入测试平台 SQLol -5.DELETE注入测试
访问首页的delete模块,http://127.0.0.1/sql/delete.php,开始对delete模块进行测试. delete语法: DELETE FROM [users] WHERE [ ...
- C++程序结构---1
C++ 基础教程Beta 版 原作:Juan Soulié 翻译:Jing Xu (aqua) 英文原版 本教程根据Juan Soulie的英文版C++教程翻译并改编. 本版为最新校对版,尚未定稿.如 ...
- ✡ leetcode 160. Intersection of Two Linked Lists 求两个链表的起始重复位置 --------- java
Write a program to find the node at which the intersection of two singly linked lists begins. For ex ...
- php构造函数实例讲解
PHP官网定义: 复制代码 代码如下: 构造函数是类中的一个特殊函数,当使用 new 操作符创建一个类的实例时,构造函数将会自动调用.当函数与类同名时,这个函数将成为构造函数.如果一个类没有构造函数, ...
- Android Studio导入GitHub上的项目常见问题(有例子)
前言:github对开发者而言无疑是个宝藏,但想利用它可不是件简单的事,用Android studio导入开源项目会遇到各种问题,今天我就以github上的一个图片轮播项目为例,解决导入过程中的常见问 ...
- SHOW OPEN TABLES – what is in your table cache
One command, which few people realize exists is SHOW OPEN TABLES – it allows you to examine what tab ...
- expect安装去测试
1.下载expect和tcl 下载地址:http://download.csdn.net/download/tobyaries/5754943 2.安装expect tar -zxvf tcl8.4. ...
- redis模块
http://www.cnblogs.com/melonjiang/p/5342505.html http://www.django-china.cn/topic/1054/ 1.连接方式 redis ...