Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.10.29;
Скачать: 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 вся ветка

Текущий архив: 2006.10.29;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.058 c
2-1160642469
Fostr
2006-10-12 12:41
2006.10.29
SQL: Parameter not found


15-1159976889
XProger
2006-10-04 19:48
2006.10.29
Задачки по Delphi


15-1160141120
partizan
2006-10-06 17:25
2006.10.29
Посоветуйте книгу по криптографии


15-1160491821
Olegzhek
2006-10-10 18:50
2006.10.29
Файл ".OBJ" из С


1-1158322098
SPACE!!
2006-09-15 16:08
2006.10.29
Хранение графических ресурсов ..