易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi中WebBrowser自动填表模板

unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,MSHTML, SHDOCVW,IdGlobal;
type
  TMainFrm = class(TForm)
    btnTest: TButton;
    edURL: TEdit;
    Label1: TLabel;
    procedure btnTestClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  MainFrm: TMainFrm;
implementation
{$R *.dfm}
procedure FillIEForm(aURL:string);
  procedure DoWithHtmlElement(aElementCollection:IHTMLElementCollection);
  var
    k:integer;
    vk:oleVariant;
    Dispatch: IDispatch;
    HTMLInputElement:IHTMLInputElement;
    HTMLSelectElement:IHTMLSelectElement;
    HTMLOptionElement: IHTMLOptionElement;
    HTMLTextAreaElement: IHTMLTextAreaElement;
    HTMLFormElement:IHTMLFormElement;
    HTMLOptionButtonElement:IHTMLOptionButtonElement;
  begin
    for k:=0 to aElementCollection.length -1 do
    begin
      Vk:=k;
      Application.ProcessMessages;
      Dispatch:=aElementCollection.item(Vk,0);
      if Succeeded(Dispatch.QueryInterface(IHTMLInputElement,HTMLInputElement)) then
      begin
        With HTMLInputElement do//单行文本
        begin
          if (UpperCase(Type_)='TEXT') or (UpperCase(Type_)='PASSWORD') then
          begin
            value:='text';
   


相关文档:

delphi中使用透明控件的几种方法

有时需要使用透明控件用于捕获鼠标消息
1.调用Windows2000,xp新的API函数实现这一功能的过程。使用SetLayeredWindowAttributes
2.直接设置控件的alphablend,alphablendvalue,间接调用上述api.
3.使用TStaticText控件
procedure WMCtrlColor(var Message: TWMCtlColor); message WM_CTLCOLOR;
procedure TForm3.WMCtr ......

Delphi 函数大全

名称 类型 说明  
abort 函数 引起放弃的意外处理  
abs 函数 绝对值函数  
addexitproc 函数 将一过程添加到运行时库的结束过程表中  
addr 函数 返回指定对象的地址  
adjustlinebreaks 函数 将给定字符串的行分隔符调整为cr/lf序列  
align 属 ......

delphi DataSnap巢状主从表实现

服务端:添加ADOConnection,ADOQuery1,ADOQuery2。设置ADOQuery1为主表,ADOQuery2为从表。(通过  ADOQuery2.SQL.Text:= 'select * from 从表 where FKID=:主表PKID'设置)。添加DataSetProvider1和DataSetProvider2分别连接到ADOQuery1和ADOQuery2。
客户端:添加ClientDataSet1,ClientDataSet2。ClientDataS ......

Delphi常用控件命名规范

 常用控件命名前缀
控件类名
前缀
TForm等窗体类 
frm
TButton, TSpeedButton等所有的按钮类 
btn
TCheckBox等所有的检查框 
chk
TRadioButton单选按钮类
rdo
TListBox等所有的列表框类 
lst
TPanel等所有的面板类
pnl
TLabel, TStaticText等所有用来显示的标签类 
lbl
TE ......

delphi string类型转integer时出错的检测

procedure TForm1.Button1Click(Sender: TObject);
Var
  Num: Integer;
Begin
  Try
    Num:=StrToInt(Edit1.Text);
    Edit2.Text:=IntToStr(Num*Num);
  Except
    On EConvertError Do   ShowMessage(Edit1.Text+'无法转成整数!'); ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号