Einzelnen Beitrag anzeigen

Benutzerbild von Bummi
Bummi

Registriert seit: 15. Jun 2010
Ort: Augsburg Bayern Süddeutschland
3.470 Beiträge
 
Delphi XE3 Enterprise
 
#4

AW: TWebBrowser Scrollbar Problem - Zugriffsverletzung beim entfernen der Scrollbar

  Alt 11. Apr 2012, 17:59
Delphi-Quellcode:
procedure TWebbrowserKeeperF.WebBrowserSet3DBorderStyle(bValue: Boolean);
var
  StrBorderStyle: AnsiString;
  tmpElement,
  tmpDocument,
  Element,
  Document : OleVariant;
begin
  if Assigned(WB) then begin
  try
    try
      Document := WB.OleObject.Document;
      if Assigned(TVarData(Document).VPointer) then begin // (varType(Document) = varDispatch) and not VarIsEmpty(Document) and not VarIsNull(Document) then begin
        Element := Document.Body;
        if Assigned(TVarData(Element).VPointer) then // and (varType(Element) = varDispatch) and not VarIsEmpty(Element) and not VarIsNull(Element)
        begin
          case bValue of
            False: StrBorderStyle := 'none';
            True: StrBorderStyle := '';
          end;
          Element.Style.BorderStyle := StrBorderStyle;
          Element.Style.overflowX := 'auto'; // horizontale Scrollbar nur bei Bedarf einblenden
          Element.Style.overflowY := 'auto'; // vertikale Scrollbar nur bei Bedarf einblenden
        end; // (mögliche Werte:
      end; // 'visible' Default. No scroll bar. Display is clipped to visible area.
    except // 'scroll' Scroll bar always visible - whether required or not.
    end; // 'hidden' No scroll bar. Content outside of visible area is hidden.
  finally // 'auto' Content is clipped and scroll bar is displayed if required.)
    Element := tmpElement;
    Document := tmpDocument;
  end;
  end;
end;
Thomas Wassermann H₂♂
Das Problem steckt meistens zwischen den Ohren
DRY DRY KISS
H₂ (wenn bei meinen Snipplets nichts anderes angegeben ist Lizenz: WTFPL)
  Mit Zitat antworten Zitat