使用 IntraWeb (14) - 基本控件之 TIWHRule、TIWRectangle
2021-04-29 23:28
134 查看
使用 IntraWeb (14) - 基本控件之 TIWHRule、TIWRectangle
TIWHRule //一条横线, 对应 Html 中的TIWRectangle //矩形; 中间可以有行文本, 文本可任意对齐
TIWHRule 所在单元及继承链:
IWHTMLControls.TIWHRule < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl < TControl < TComponent < TPersistent < TObject
它没什么特别的成员, 下面是通过样式表把它改成红线:
procedure TIWForm1.IWAppFormCreate(Sender: TObject); begin IWHRule1.Width := Width div 2; IWHRule1.Height := 3; IWHRule1.Left := (Width - IWHRule1.Width) div 2; IWHRule1.Top := 60; IWHRule1.Anchors := [akLeft, akTop, akRight]; end; procedure TIWForm1.IWHRule1HTMLTag(ASender: TObject; ATag: TIWHTMLTag); begin ATag.Params.Values['style'] := ATag.Params.Values['style'] + 'background-color: red; border:0;'; end;
TIWRectangle 所在单元及继承链:
IWCompRectangle.TIWRectangle < TIWCustomRectangle < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl < TControl < TComponent < TPersistent < TObject
主要成员:
property BorderOptions: TIWBorderOptions //边框选项; 主要是 Width 和 Color property Color: TIWColor //矩形的颜色 property Alignment: TAlignment //文本水平对齐方式 property VAlign: TIWVerticalAlignment //文本垂直对齐方式 property Text: TCaption //文本
示例:
procedure TIWForm1.IWAppFormCreate(Sender: TObject); begin IWRectangle1.BorderOptions.Width := 1; IWRectangle1.BorderOptions.Color := $0000FF; IWRectangle1.Color := $F0E0E0; IWRectangle1.Text := '万一的 Delphi 博客'; IWRectangle1.Font.Color := $0000FF; IWRectangle1.Font.Size := 16; IWRectangle1.Alignment := taCenter; IWRectangle1.VAlign := vaMiddle; end;
相关文章推荐
- 使用 IntraWeb (15) - 基本控件之 TIWEdit、TIWMemo、TIWText
- 使用 IntraWeb (17) - 基本控件之 TIWRadioButton、TIWRadioGroup、TIWCheckBox
- 使用 IntraWeb (16) - 基本控件之 TIWList、TIWListbox、TIWComboBox、TIWOrderedListbox
- 使用 IntraWeb (40) - 自定义 Session 数据
- 使用 IntraWeb (2) - Hello IntraWeb
- 使用 IntraWeb (41) - 数据控件速查
- 使用 IntraWeb (42) - 测试读取 SqLite (一)
- 使用 IntraWeb (43) - 测试读取 SqLite (二)
- 使用 IntraWeb (45) - 活用 IntraWeb
- 使用 IntraWeb (1) - 先测试如何部署为 Asp.Net 的应用
- 使用 IntraWeb (25) - 基本控件之 TIWRegion
- 使用 IntraWeb (44) - 测试读取 SqLite (三)
- 使用defineProperty实现自定义setter, 简化前端Angular的重构工作
- 从一个 10 年程序员的角度告诉你:搞懂 Java 面向对象有多容易?
- Api接口:手机空号状态过滤检测
- Python工程师的大数据之路(6c)Kafka理论知识
- 邮递员算法问题之c++实现
- API 版本控制小技巧
- STM32属于哈佛结构还是冯诺依曼结构?
- windows10使用docker搭建开发环境