Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  4 650

•  TDictionary Custom Sort  6 656

•  Fast Watermark Sources  6 436

•  3D Designer  9 376

•  Sik Screen Capture  6 766

•  Patch Maker  7 164

•  Айболит (remote control)  7 167

•  ListBox Drag & Drop  6 020

•  Доска для игры Реверси  97 632

•  Графические эффекты  7 346

•  Рисование по маске  6 637

•  Перетаскивание изображений  5 502

•  Canvas Drawing  5 884

•  Рисование Луны  5 618

•  Поворот изображения  5 115

•  Рисование стержней  3 695

•  Paint on Shape  2 919

•  Генератор кроссвордов  3 821

•  Головоломка Paletto  3 063

•  Теорема Монжа об окружностях  3 871

•  Пазл Numbrix  2 548

•  Заборы и коммивояжеры  3 276

•  Игра HIP  2 246

•  Игра Go (Го)  2 176

•  Симулятор лифта  2 558

•  Программа укладки плитки  2 187

•  Генератор лабиринта  2 686

•  Проверка числового ввода  2 334

•  HEX View  2 670

•  Физический маятник  2 311

 
скрыть

Заполнение полей формы в TWebBrowser методом Drag-and-Drop



Оформил: DeeCo

{ 
  This example shows how to fill out fields in your webbrowser by 
  dragging the content of Label1 to a field of your webbrowser}

 { 
  Mit diesem Beispiel kann der Inhalt von Label1 per Drag & Drop 
  in die Edit Felder gefullt werden. 
}


 procedure TForm1.FormCreate(Sender: TObject);
 begin
   label1.DragMode := dmAutomatic;
 end;


 procedure TForm1.WebBrowserDragOver(Sender, Source: TObject; X,
   Y: Integer; State: TDragState; var Accept: Boolean);
 var
   item: Variant;
 begin
   //check if document is interactive 
  if (Webbrowser.ReadyState and READYSTATE_INTERACTIVE) = 3 then
   begin
     item := WebBrowser.OleObject.Document.elementFromPoint(x, y);
     if Source is TLabel then
       Accept := True;
     Accept := (item.tagname = 'INPUT') and ((item.type = 'text') or
       (item.type = 'password')) or (item.tagname = 'TEXTAREA');
   end;
 end;

 procedure TForm1.WebBrowserDragDrop(Sender, Source: TObject; X,
   Y: Integer);
 var
   item: Variant;
 begin
   //check if document is interactive 
  if (Webbrowser.ReadyState and READYSTATE_INTERACTIVE) = 3 then
   begin
     item       := WebBrowser.OleObject.Document.elementFromPoint(x, y);
     item.Value := label1.Caption;
   end;
 end;




Похожие по теме исходники

Сортировка методом Хоара

Текст Drag & Drop

Drag and Drop Text

Quick Drag & Drop

 

Dragster Tree Relay

ListBox Drag & Drop

Backup and Restore

Market Monitoring and Billing

 

Black and White Effects

Sand Dog

Wave and MIDI In-Out

Vista and 7 Sound

 

Improved Buttons and ProgressBar

Desktop Sands

Rotation and Symmetry

Dropper (пипетка Фотошоп)