所在单元及继承链:
IWCompButton.TIWButton < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl < TControl < TComponent < TPersistent < TObject

主要成员:


  1. property ButtonType: TIWButtonType //!, 示例中详述
  2. property HotKey: string //热键; 譬如: HotKey = 'j', 那么热键就是: Alt+J
  3. property Confirmation: string //指定此信息后, 将弹出问询窗; 只有确认后才会执行 OnClick; 这非常方便, 也很有创意
  4. property DoSubmitValidation: Boolean //是否在提交时验证其他...
  5. property ExtraTagParams: TStringList //添加 Html Tag; 不要用于修改 Html Tag
  6. property FriendlyName: string //呈现给用户的名称
  7. property ScriptEvents: TIWScriptEvents //客户端的 js 事件脚本
  8. property WebColor: TIWColor //没看出和 Color 的区别
  9. property WebFont: TIWFont //没看出和 Font 的区别
  10. property Css: string //引用在样式表中定义的类; 譬如在样式表定义有 .MyClass1, 这里就可以设置 Css := 'MyClass1';
  11. property StyleRenderOptions: TIWStyleRenderOptions //指定哪些类别的样式设置可用于最终的呈现; 因为一些属性可能会和样式表有冲突
  12. property Caption: TCaption //标题
  13. property Text: TCaption //在该控件中, Text 和 Caption 没有区别
  14. property DoRefreshControl: Boolean //它默认是 False, 但在修改某些属性时必须让它为 True 才会有效
  15.  
  16. property OnClick: TNotifyEvent //与 ScriptEvents 中的 onclick 不同, 这会使整个页面提交, 就像 Submit 按钮一样
  17. property OnAsyncClick: TIWAsyncEvent //异步 Click; 难得见到这么简单的 AJAX 的实现
  18. property OnHTMLTag: TIWOnHTMLTag //事件发生在呈现 Html Tag 时; 可借机修改那些 Tag
  19.  
  20. function RenderHTML(AContext: TIWCompContext): TIWHTMLTag //类似的还有 RenderStyle 等, 这应该是在继承控件时使用的; 现在可以使用 OnHTMLTag
  21. function GetSubmitParam: string //?
  22. function OwnerForm: TIWBaseForm //所属窗体; 譬如获取 IWButton1.OwnerForm.Name 的结果是 IWForm1

ButtonType 属性:


  1. //在 Html 中的按钮有三种 Type: button、 submit、 reset, 分别表示: 一般按钮、提交按钮、重置按钮
  2. //该属性的本意就是这个, 但现在它不起作用
  3. //它默认是 button, 是否是指定为 submit 也不重要, TIWButton.OnClick 会自动提交; 但 reset 还是有用的
  4.  
  5. //在作者没有修正前, 可以先通过它的 OnHTMLTag 事件设置:
  6. procedure TIWForm1.IWButton1HTMLTag(ASender: TObject; ATag: TIWHTMLTag); //可能需手动 uses IWHTMLTag
  7. begin
  8. ATag.Params.Values['type'] := 'reset';
  9. end;
  10.  
  11. {能接受重置的其他输入控件必须和重置按钮在同一 Region 内, 或都不在 Region 内}

DoSubmitValidation、FriendlyName 属性:


  1. //在空窗体上放 IWEdit1、IWButton1, 写代码如下:
  2. procedure TIWForm1.IWAppFormCreate(Sender: TObject);
  3. begin
  4. IWEdit1.Required := True; //指定为必填字段
  5. IWEdit1.FriendlyName := '姓名字段'; //在验证提示时将使用这个名称
  6. // IWButton1.DoSubmitValidation := False; //TIWButton.DoSubmitValidation 默认是 True; 如果指定为 False, 就不会执行验证了
  7. end;
  8.  
  9. procedure TIWForm1.IWButton1Click(Sender: TObject);
  10. begin
  11. //只是测试提交, 这里不需要有代码
  12. end;
  13.  
  14. //测试: 运行后, 清空 IWEdit1, 点击按钮, 将会弹出验证提示.

ExtraTagParams 属性:


  1. procedure TIWForm1.IWAppFormCreate(Sender: TObject);
  2. begin
  3. IWButton1.ExtraTagParams.Add('style = color: red');
  4. end;

Css 属性:


  1. procedure TIWForm1.IWAppFormCreate(Sender: TObject);
  2. begin
  3. ExtraHeader.Add('<style>');
  4. ExtraHeader.Add('.MyClass1 {color: blue;}');
  5. ExtraHeader.Add('</style>');
  6.  
  7. IWButton1.Css := 'MyClass1';
  8. end;

使用 IntraWeb (11) - 基本控件之 TIWButton的更多相关文章

  1. 微软 microsoft calendar control 11.0 控件下载

    微软 microsoft calendar control  11.0 控件下载 https://files.cnblogs.com/files/mqingqing123/csccal2.rar

  2. 使用 IntraWeb (24) - 基本控件之 TIWFileUploader、TIWFile

    TIWFileUploader 是基于 Ajax 的上传控件, 最初是 Andrew Valums 开发, 从 IntraWeb XIV 纳入并替换 TIWFile. 虽然从组件面板上还能看到 TIW ...

  3. 使用 IntraWeb (29) - 基本控件之 TIWAutherList、TIWAutherINI、TIWAutherEvent

    TIWAutherList //通过一组户名与密码验证登陆 TIWAutherINI //通过记录户名与密码信息的 #Auth.ini 文件验证登陆 TIWAutherEvent //通过其 OnCh ...

  4. 使用 IntraWeb (28) - 基本控件之 TIWTemplateProcessorHTML、TIWLayoutMgrHTML、TIWLayoutMgrForm

    TIWTemplateProcessorHTML //使用外部的 html 文件做模板 TIWLayoutMgrHTML //直接输入 Html 文本做模板 TIWLayoutMgrForm //这应 ...

  5. 使用 IntraWeb (26) - 基本控件之 TIWMenu

    TIWMenu 的任务是让原来的 TMainMenu 呈现在网页上, 通过其 AttachedMenu 属性关联一个 TMainMenu 是必需的. TIWMenu 所在单元及继承链: IWCompM ...

  6. 使用 IntraWeb (25) - 基本控件之 TIWRegion

    这应该是 IW 中最重要的容器了, 和它同父的还有 TIWTabControl TIWRegion 所在单元及继承链: IWRegion.TIWRegion 主要成员: property Align: ...

  7. 使用 IntraWeb (23) - 基本控件之 TIWTimer、TIWProgressBar、TIWProgressIndicator、TIWTimeEdit

    TIWTimer //和 TTimer 没多大区别, 它的默认事件现在是异步的(OnAsyncTimer), 在网络上使用 OnTimer 肯定是非常糟糕的 TIWProgressBar //进度条 ...

  8. 使用 IntraWeb (22) - 基本控件之 TIWCalendar

    TIWCalendar: 日历控件, 继承于 TIWCustomGrid, 所以它和 TIWGrid 共同属性特多. 它的 Cell 是 TIWCalendarCell 对象, 直接从 TIWGrid ...

  9. 使用 IntraWeb (20) - 基本控件之 TIWGrid

    TIWGrid 最终通过 Html Table 呈现; 其每个 Cell 都是一个 TIWGridCell 对象, Cell 对象的 Control 属性非常好, 可以非常方便地嵌入其他控件. TIW ...

随机推荐

  1. Python 装饰器入门(上)

    翻译前想说的话: 这是一篇介绍python装饰器的文章,对比之前看到的类似介绍装饰器的文章,个人认为无人可出其右,文章由浅到深,由函数介绍到装饰器的高级应用,每个介绍必有例子说明.文章太长,看完原文后 ...

  2. fuzz for test of the Net::HTTP::GET

    use Net::HTTP::GET; % %0e%0f ' *%26 @.jpg>; my $count = 0; for @chars X @chars X @chars X @chars ...

  3. docker之容器访问和网络连接(三)

    前言 当一台服务器上部署了多个应用容器,它们直接可能需要相互通信,比如web应用容器需要访问mysql数据库容器. 主机访问容器 通过映射端口的形式我们可以在外部访问容器内的服务 # 将主机的127. ...

  4. linux中serial driver理解【转】

    转自:http://blog.csdn.net/laoliu_lcl/article/details/39967225 英文文档地址:myandroid/kernel_imx/Documentatio ...

  5. springcloud中Feign配置详解

    Spring Cloud中Feign配置详解 到目前为止,小伙伴们对Feign的使用已经掌握的差不多了,我们在前文也提到Feign是对Ribbon和Hystrix的整合,那么在Feign中,我们要如何 ...

  6. MAC连接安卓手机通过adb指令安装apk

    Android的apk可以通过adb命令来安装.在MAC电脑上,如果想通过命令行的方式给安卓手机安装apk,需要做以下操作: 一句话概括就是:将安卓SDK的adb命令添加到环境变量中,然后通过adb ...

  7. @PostConstruct和@PreConstruct

    详情参见:https://www.cnblogs.com/landiljy/p/5764515.html 1.@PostConstruct说明 被@PostConstruct修饰的方法会在服务器加载S ...

  8. 06 Go 1.6 Release Notes

    Go 1.6 Release Notes Introduction to Go 1.6 Changes to the language Ports Tools Cgo Compiler Toolcha ...

  9. numpy和pandas简单使用

    numpy和pandas简单使用 import numpy as np import pandas as pd 一维数据分析 numpy中使用array, pandas中使用series numpy一 ...

  10. TimedSupervisorTask

    啊啊啊 UnsupportedOperationException Lists.emptyLIst() . add (String[] ) 这他妈的不行.. .2017/09/13 16:42:16. ...