PB控件属性之SingleLineEdit、EditMask、MultiLineEdit、RichTextEdit、StaticText和StaticHyperLink

文本编辑:SingleLineEdit-单行编辑器、EditMask-屏蔽编辑器、MultiLineEdit-多行编辑器、RichTextEdit-富文本编辑器
文本显示:StaticText-静态文本控件、StaticHyperLink-静态联结

 

SingleLineEdit(单行编辑器)

【属性】

▲Visible
缺省为True。当为False时,该控件在窗口上隐藏。

▲Enabled
缺省为True。当为False时,该控件不能获得焦点,用户不能进行编辑和选中;控件背景为灰色。

▲DisplayOnly
缺省为False。当为True时,该控件中的文字不能被修改,并且也不能输入,但可以选中、复制。

▲Password
缺省为False。当为True时,在该输入框中输入的内容显示为“*”号,星号的数目等于输入的字符的数目,加密规则依赖于操作系统。其实际内容和用户输入的内容一致。

▲AutoHScroll
缺省为True,表示当用户输入的内容显示不下时,可以自动横向滚动光标,但是不显示滚动条。

▲HideSelection
缺省为True,表示只有当单行编辑器获得焦点时,才高亮显示选中文本。建议使用缺省值,因为将该属性设置为False,没有获得焦点时,选中的内容就高亮显示,这容易让用户造成错误。

▲Limit
缺省是0,表示没有长度限制。可以输入其他一个数字,表示该单行编辑框中最多接受用户输入的字符个数,最大数字是32 767。

▲TextCase
有三个选项,upper!表示用户输入的内容中的字母都自动转换成大写,lower!表示都自动转换成小写,anycase!表示不做转换。

▲Text
这是该控件运行时最经常使用的一个属性。可以给该属性赋值来将特定信息显示在单行编辑器中,也可以读取该属性而获得单行编辑器中的内容。设计状态下,在Text属性输入框中录入的文字在窗口刚刚打开时显示在单行编辑框中。

▲Border
是否显示边框,缺省为True

【事件】
单行编辑器提供了12个事件,Modified是经常使用的事件,其他事件和命令按钮的同名事件完全相同

◆Modified
该事件的触发时机是在编辑器中输入内容后,焦点离开该编辑器时


【函数】
单行编辑器提供了很多的函数,其中需要掌握的有10个经常使用的函数,这10个常用函数是CanUndo、Cle

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
pb动态创建树和菜单 forward global type w_tv from window end type type cb_2 from commandbutton within w_tv end type type cb_1 from commandbutton within w_tv end type type sle_1 from singlelineedit within w_tv end type type st_1 from statictext within w_tv end type end forward global type w_tv from window integer width = 1381 integer height = 620 boolean titlebar = true string title = "Untitled" boolean controlmenu = true windowtype windowtype = response! long backcolor = 67108864 string icon = "AppIcon!" boolean center = true cb_2 cb_2 cb_1 cb_1 sle_1 sle_1 st_1 st_1 end type global w_tv w_tv on w_tv.create this.cb_2=create cb_2 this.cb_1=create cb_1 this.sle_1=create sle_1 this.st_1=create st_1 this.Control[]={this.cb_2,& this.cb_1,& this.sle_1,& this.st_1} end on on w_tv.destroy destroy(this.cb_2) destroy(this.cb_1) destroy(this.sle_1) destroy(this.st_1) end on event open;String ls_Parm, ls_temp, ls_Name, ls_title ls_Parm = Trim( Message.StringParm ) ls_temp = Right( ls_Parm, 1 ) ls_Name = Left( ls_Parm, Lenw( ls_Parm ) - 2 ) IF ls_temp = 'T' THEN ls_title = '添加 ' + ls_Name + ' 的同类' END IF IF ls_temp = 'Z' THEN ls_title = '添加 ' + ls_Name + ' 的子类' END IF IF ls_temp = 'M' THEN ls_title = '修改 ' Sle_1.text = ls_Name Sle_1.SelectText( 1, Len( ls_Name ) ) END IF title = ls_title end event type cb_2 from commandbutton within w_tv integer x = 727 integer y = 360 integer width = 457 integer height = 128 integer taborder = 20 integer textsize = -12 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" string text = "退出(&E)" boolean cancel = true end type event clicked;CloseWithReturn( Parent, '' ) end event type cb_1 from commandbutton within w_tv integer x = 165 integer y = 360 integer width = 457 integer height = 128 integer taborder = 30 integer textsize = -12 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" string text = "确定(&O)" boolean default = true end type event clicked;String ls_Name ls_Name = Trim( sle_1.text ) CloseWithReturn( Parent, ls_Name ) end event type sle_1 from singlelineedit within w_tv integer x = 64 integer y = 156 integer width = 1234 integer height = 128 integer taborder = 10 integer textsize = -12 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type type st_1 from statictext within w_tv integer x = 64 integer y = 40 integer width = 457 integer height = 72 integer textsize = -12 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 long backcolor = 67108864 string text = "类别名称" boolean focusrectangle = false end type

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值