Вниз
Скачать: CL | DM;

Определить активный элемент в TWebbrowser   Найти похожие ветки 

← →
Spose ©   (2005-08-24 17:53) [0]

Мне надо узнать какой элемент типа Text, TextArea или Password на одной из форм в данный момент активен (или редаектируется, т.е. на нем мигает курсор).

Получить список самих элементов очень просто (в примере в memo1 заносятся значения этих элементов):
var
   ovElements: OleVariant;
   i,m: Integer;
begin
  for m := 0 to Wb.OleObject.Document.forms.Length - 1 do
  begin
   ovElements := Wb.OleObject.Document.forms.item(m).elements;
   for i := 0 to (ovElements.Length - 1) do
    if (ovElements.item(i).tagName = "INPUT") then
    if (ovElements.item(i).type = "text")or(ovElements.item(i).type = "password")or(ovElements.item(i).type = "textarea") then
      memo1.Lines.Add(ovElements.item(i).Value);
  end;
end;


← →
programania ©   (2005-08-25 22:51) [1]


var
ID: IHTMLDocument2;
IL: IHTMLElement;
...
form1.webBrowser1.Document.QueryInterface(IHTMLDocument2, ID);
if ID<>nil then   begin
 IL:=ID.Get_activeElement;
 if copy(lowerCase(IL.Get_outerHTML),1,9)="<textarea" then begin
...



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.035 c
15-1160238767
wp2
2006-10-07 20:32
2006.10.29
помогите кто может.


2-1160988912
Jimmy
2006-10-16 12:55
2006.10.29
Работа с Sys Tray.


1-1158232320
Артем22
2006-09-14 15:12
2006.10.29
PNG и DrawGrid


2-1160637215
md
2006-10-12 11:13
2006.10.29
unit


2-1160635467
_RusLAN
2006-10-12 10:44
2006.10.29
Посоветуйте библиотеку для для создания отчетов в Excel




   Наверх