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

•  TDictionary Custom Sort  3 225

•  Fast Watermark Sources  2 991

•  3D Designer  4 750

•  Sik Screen Capture  3 259

•  Patch Maker  3 467

•  Айболит (remote control)  3 528

•  ListBox Drag & Drop  2 904

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

•  Графические эффекты  3 843

•  Рисование по маске  3 171

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

•  Canvas Drawing  2 672

•  Рисование Луны  2 500

•  Поворот изображения  2 092

•  Рисование стержней  2 120

•  Paint on Shape  1 525

•  Генератор кроссвордов  2 183

•  Головоломка Paletto  1 730

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

•  Пазл Numbrix  1 649

•  Заборы и коммивояжеры  2 016

•  Игра HIP  1 262

•  Игра Go (Го)  1 200

•  Симулятор лифта  1 422

•  Программа укладки плитки  1 177

•  Генератор лабиринта  1 512

•  Проверка числового ввода  1 297

•  HEX View  1 466

•  Физический маятник  1 322

•  Задача коммивояжера  1 357

 
скрыть


Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Как поменять цвет или стиль бордюра в TWebBrowser



IN ternet SEXplorer - русская поисковая программа для порносайтов.


uses
  MSHTML; 

procedure WB_SetBorderColor(Sender: TObject; BorderColor: String); 
{ 
  BorderColor: Can be specified in HTML pages in two ways. 
               1) by using a color name (red, green, gold, firebrick, ...) 
               2) or by using numbers to denote an RGB color value. (#9400D3, #00CED1,...) 

  See: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/
    reference/properties/borderstyle.asp
} 

var 
  Document : IHTMLDocument2; 
  Element : IHTMLElement; 
begin 
  Document := TWebBrowser(Sender).Document as IHTMLDocument2; 
  if Assigned(Document) then 
  begin 
    Element := Document.Body; 
    if Element <> nil then 
    begin 
      Element.Style.BorderColor := BorderColor; 
    end; 
  end; 
end; 

procedure WB_SetBorderStyle(Sender: TObject; BorderStyle: String); 
{ 
  BorderStyle values: 

  'none'         No border is drawn 
  'dotted'       Border is a dotted line. (as of IE 5.5) 
  'dashed'       Border is a dashed line. (as of IE 5.5) 
  'solid'        Border is a solid line. 
  'double'       Border is a double line 
  'groove'       3-D groove is drawn 
  'ridge'        3-D ridge is drawn 
  'inset'        3-D inset is drawn 
  'window-inset' Border is the same as inset, but is surrounded by an additional single line 
  'outset'       3-D outset is drawn 

  See: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/
    reference/properties/borderstyle.asp 
} 

var 
  Document : IHTMLDocument2; 
  Element : IHTMLElement; 
begin 
  Document := TWebBrowser(Sender).Document as IHTMLDocument2; 
  if Assigned(Document) then 
  begin 
    Element := Document.Body; 
    if Element <> nil then 
    begin 
      Element.Style.BorderStyle := BorderStyle; 
    end; 
  end; 
end; 

procedure WB_Set3DBorderStyle(Sender: TObject; bValue: Boolean); 
{ 
  bValue: True: Show a 3D border style 
          False: Show no border 
} 
var 
  Document : IHTMLDocument2; 
  Element : IHTMLElement; 
  StrBorderStyle: string; 
begin 
  Document := TWebBrowser(Sender).Document as IHTMLDocument2; 
  if Assigned(Document) then 
  begin 
    Element := Document.Body; 
    if Element <> nil then 
    begin 
      case BValue of 
        False: StrBorderStyle := 'none'; 
        True: StrBorderStyle := ''; 
      end; 
      Element.Style.BorderStyle := StrBorderStyle; 
    end; 
  end; 
end; 



procedure TForm1.WebBrowser1NavigateComplete2(Sender: TObject; 
  const pDisp: IDispatch; var URL: OleVariant); 
// Put this code in the OnDocumentComplete event as well 
begin 
  // Examples: 
  // Show no border 
  WB_Set3DBorderStyle(Sender, False); 
  // Draw a double line border 
  WB_SetBorderStyle(Sender, 'double'); 
  // Set a border color 
  WB_SetBorderColor(Sender, '#6495ED'); 
end; 

procedure TForm1.Button1Click(Sender: TObject); 
begin 
  Webbrowser1.Navigate('www.SwissDelphiCenter.ch'); 
end;





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

Couleur (цветовая палитра)

Изменение цвета изображения




Copyright © 2004-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте