Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.WebBrowser1CommandStateChange(ASender: TObject;
- Command: Integer; Enable: WordBool);
- var
- KCustom, Namcust, Almat, Nopons, KapKand1, Population: String;
- function GetIdValue(const Id : string):string;
- var
- Tag : IHTMLElement;
- TagsList : IHTMLElementCollection;
- Index : Integer;
- begin
- Result:='';
- TagsList := ABody.getElementsByTagName('input');
- for Index := 0 to TagsList.length-1 do
- begin
- Tag:=TagsList.item(Index, EmptyParam) As IHTMLElement;
- if CompareText(Tag.id,Id)=0 then
- Result := Tag.getAttribute('value', 0);
- end;
- end;
- begin
- if TOleEnum(Command) <> CSC_UPDATECOMMANDS then
- Exit;
- ADocument := WebBrowser1.Document as IHTMLDocument2;
- if not Assigned(ADocument) then
- Exit;
- if not Supports(ADocument.body, IHTMLElement2, ABody) then
- Exit;
- KCustom:=GetIdValue('KCust');
- NamCust:=GetIdValue('NamCust');
- Almat:=GetIdValue('Alamat');
- Nopons:=GetIdValue('nopon');
- KapKand1:=GetIdValue('kapka');
- Population:=GetIdValue('polasi');
- QListCust.Locate('Kode_Cus', ''+KCustom+'', [loCaseInsensitive]);
- if (Namcust<>'') and (Almat<>'') and ((Namcust<>ENma.Text) or (Almat<>EAlmt.Text)) then
- begin
- ENma.Text:=GetIdValue('NamCust');
- EAlmt.Text:=Almat;
- EPhone.Text:=Nopons;
- ECap.Text:=KapKand1;
- ETotPop.Text:=Population;
- PBawahDetail.Visible:=true;
- end; exit; exit;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement