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

•  DeLiKaTeS Tetris (Тетрис)  3 670

•  TDictionary Custom Sort  5 800

•  Fast Watermark Sources  5 603

•  3D Designer  8 218

•  Sik Screen Capture  5 913

•  Patch Maker  6 388

•  Айболит (remote control)  6 378

•  ListBox Drag & Drop  5 237

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

•  Графические эффекты  6 570

•  Рисование по маске  5 644

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

•  Canvas Drawing  5 135

•  Рисование Луны  4 863

•  Поворот изображения  4 411

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

•  Paint on Shape  2 360

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

•  Головоломка Paletto  2 551

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

•  Пазл Numbrix  2 200

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

•  Игра HIP  1 820

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

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

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

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

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

•  HEX View  2 226

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

 
скрыть

  Форум  

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-2025 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

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