HTMLViewer Scrolling

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
hagchr
Automation Wizard
Posts: 327
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

HTMLViewer Scrolling

Post by hagchr » Mon Sep 05, 2016 4:28 pm

Anybody that knows how I can get the horizontal scrolling to work in the HTMLViewer? I have other scripts where it works fine but somehow I am missing something here (if I extend the line then the vertical scroll appears as expected).

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  AlignWithMargins = True
  Left = 247
  Top = 97
  Width = 386
  Height = 250
  HelpContext = 5000
  AutoScroll = True
  BorderIcons = [biSystemMenu]
  Caption = 'CustomDialog'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object MSHTMLViewer1: tMSHTMLViewer
    Left = 91
    Top = 20
    Width = 182
    TabOrder = 0
    BorderStyle = htSingle
    DefFontName = 'Times New Roman'
    DefPreFontName = 'Courier New'
    HistoryMaxCount = 0
    NoSelect = False
    PrintMarginBottom = 2.000000000000000000
    PrintMarginLeft = 2.000000000000000000
    PrintMarginRight = 2.000000000000000000
    PrintMarginTop = 2.000000000000000000
    PrintScale = 1.000000000000000000
  end
end
EndDialog>Dialog1

LabelToVar>tmpHTML,myHTML

SetDialogProperty>Dialog1,msHTMLViewer1,HTML,myHTML
Show>Dialog1,

/*
tmpHTML:
<p>This is an example of a very long long long long long long long long long line</p>	
*/

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: HTMLViewer Scrolling

Post by Marcus Tettmar » Tue Sep 06, 2016 7:45 am

When I ran your code there were no scroll bars because the text fitted into the htmlviewer - there was no need for scrolling. But when I made the text longer or shrank the viewer, the scroll bars became available.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

hagchr
Automation Wizard
Posts: 327
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Re: HTMLViewer Scrolling

Post by hagchr » Tue Sep 06, 2016 7:52 am

It is one line without line breaks, is there a way not to wrap the text?

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: HTMLViewer Scrolling

Post by Marcus Tettmar » Tue Sep 06, 2016 7:57 am

It would depend on the HTML. E.g.

Code: Select all

/*
tmpHTML:
<pre>This is an example of a very long long long long long long long long long line</pre>   
*/
That would stop it wrapping and then you see the horizontal scroll bar.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

hagchr
Automation Wizard
Posts: 327
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Re: HTMLViewer Scrolling

Post by hagchr » Tue Sep 06, 2016 8:07 am

Great, many thanks!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts