Jump to content

scienceguy

Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. scienceguy

    TWebBrowser: Remove Scrollbars not working

    YES!! That works ! Finally !! Many thanks to all of you, you were a great help ! Cheers and enjoy your day
  2. scienceguy

    TWebBrowser: Remove Scrollbars not working

    Ok. So does this means that there is no possibility at all to remove a scrollbar in a TWebBrowser? There is an option "Select Engine". But only IEXPLORER and EDGE are available. But other browsers are installed on my pc.
  3. scienceguy

    TWebBrowser: Remove Scrollbars not working

    Unfortunately that doesn't work.
  4. scienceguy

    TWebBrowser: Remove Scrollbars not working

    Dear all, I am displaying html files in a TWebBrowser Component. My files are small enough that no scrollbars are required. However, I don't get to remove them. Of course I searched and had a try with both the overflow parameter and Borderstyle. However, none of them seems to work. I read that I need to apply those commands AFTER the document has been loaded. Thats why I tried "OnDocumentComplete" as well as shortly after I display my document. Thats my Code to display HTML code: procedure TForm1.LoadHtmlCode(var filename:string); VAR Doc: Variant; htmlcode:string; begin // Load Htmlcode from File // init htmlcode:=''; htmlcode:=TFile.ReadAllText(filename); if NOT Assigned(wbBrowser.Document) then wbBrowser.Navigate('about:blank'); // Display HTML Code Doc := wbBrowser.Document; Doc.Clear; Doc.Write(htmlcode); Doc.Close; Doc.DesignMode := 'Off'; WHILE wbBrowser.ReadyState < READYSTATE_INTERACTIVE DO Application.ProcessMessages; doc.body.style.fontFamily:='Arial'; wbBrowser.OleObject.Document.bgColor := '#000000'; end; procedure TForm1.wbBrowserDocumentComplete(ASender: TObject; const pDisp: IDispatch; const URL: OleVariant); begin //wbBrowser.OleObject.Document.Body.Style.OverflowX := 'hidden'; //wbBrowser.OleObject.Document.Body.Style.OverflowY := 'hidden'; wbBrowser.OleObject.Document.body.Style.BorderStyle := 'none'; wbBrowser.OleObject.Document.body.Scroll := 'no'; end; Has anyone an Idea ? Many thanks !
  5. scienceguy

    Delphi WebBrowser Display Problem

    Oh thanks Peter!! Makes totally sense- it works now ! And cheers for the ReadAllText, didn't knew that one, makes life simple 🙂 Another question: I try to hide the scrollbars. My html document is only a few sentences such that no scrolling is needed, however the bar is still there. Even after adding the following code AFTER loading my html page // hide scrollbar wbBrowser.OleObject.Document.Body.Style.OverflowX := 'hidden'; wbBrowser.OleObject.Document.Body.Style.OverflowY := 'hidden'; Is there another possibility?
  6. scienceguy

    Delphi WebBrowser Display Problem

    Dear all, I have a problem with the display of HTML code in the Delphi Webbrowser. Following problem: If I write html code that includes an image, then the image is not displayed in Delphi, I only see a cross. But the html file is being displayed correctly in a normal browser. However, If I use a website like WordToHtml Converter, and take that html code, than the image is displayed correctly in Delphi. Both Html codes are identical, with the difference that the source of the image is then coming from that converter website.. I do not really understand what the problem is. The formatting is displayed correctly. My Delphi code to display html code looks like this: // Load HTML File and Display it in WBBROWSER procedure TForm1.LoadHtmlCode(var filename:string); //https://stackoverflow.com/questions/41957051/how-to-change-font-in-twebbrowser VAR Doc: Variant; htmlcode:string; textfile2:TextFile; // html file temp:string; begin // Load Htmlcode from File // init htmlcode:=''; AssignFile(textfile2, filename); reset(textfile2); while not eof(textfile2) do begin readln(textfile2, temp); htmlcode:=htmlcode+temp; end; CloseFile(textfile2); if NOT Assigned(wbBrowser.Document) then wbBrowser.Navigate('about:blank'); // Display HTML Code Doc := wbBrowser.Document; Doc.Clear; Doc.Write(htmlcode); Doc.Close; Doc.DesignMode := 'Off'; WHILE wbBrowser.ReadyState < READYSTATE_INTERACTIVE DO Application.ProcessMessages; doc.body.style.fontFamily:='Arial'; wbBrowser.OleObject.Document.bgColor := '#000000'; end; And my simple HTML code: <!DOCTYPE html> <html> <body> <p style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:0cm;line-height:107%;font-size:15px;font-family:"Calibri",sans-serif;text-align:justify;'><span data-darkreader-inline-color="" style="font-size: 29px; line-height: 107%; font-family: Corbert; color: white; --darkreader-inline-color: #e8e6e3;">blablabla.</span></p> <img src="img/Antenne.png" height="80" width="50"> </span> </p> </body> </html> Many thanks Enjoy your day
×