HTMLViewer: Vertical Scroll Bar

I am trying to use the HTMLViewer to display HTML documents and am having trouble getting the Vertical Scroll Bar to work, it acts like it is disabled (for that matter the entire control seems like it is disabled). The scroll bar works when I load an HTML document that was generated/saved from MS Word. But I try the same with a much more basic HTML document then the vertical scroll bar is disabled. I’ve tried both the LoadURL and LoadPage methods and get the same results. I’ve also tried setting Enabled property of the HTMLViewer to False and True at the beginning and completion of loading the HTML document. Is XOJO looking for a tag in the HTML that triggers the vertical scroll bar to be enabled? The document is definitely large enough so that the scroll bar is applicable so it must be something else I am missing. Any feedback greatly appreciated.

No. the only requirement to have a vertical scrollbar is to enter text that is longer than the field provided. It makes no sense that your results would vary based upon the source of your HTML. Are you using the .LoadPage method to populate your HTMLViewer? Are you sure your code is not inadvertently disabling the control?

Correction, it doesn’t make any difference on the source of the HTML, the vertical scroll bar is present but it isn’t enabled. I also tried a regular webpage and received same results and couldn’t click the links from that webpage (and that page works fine from a browser). It’s like the entire HTMLViewer control is disabled, even though I added code to enable it.

What is the code you used?

This code is from the method where I am loading the URL. The method is within the window that has the HTMLViewer control. I have hardcoded the URL string to make the code easier to read from this thread (as opposed to figuring out my variables). The page loads fine, it is just that the control is not enabled.

''Load an HTML document from computer hard drive
WindowHTMLReportsViewer.HTMLViewer1.Enabled = False
WindowHTMLReportsViewer.HTMLViewer1.LoadURL(“file:///C:/Users/Richard/Documents/Dombrov%20Baseball%20Sim/Data/Seasons/1976/Reports/Standings_1976.htm”)
WindowHTMLReportsViewer.HTMLViewer1.Enabled = True

''Or loading a webpage
WindowHTMLReportsViewer.HTMLViewer1.LoadURL(“http://www.dombrov.com/”)

I also added this to the DocumentBegin event for the HTMLViewer control
me.Enabled = False
And this to the DocumentComplete event for the HTMLViewer control
me.Enabled = True

The size of the window is 1366 x 768 and has a backdrop and is maximized (but also tried it not maximized)
The size of the HTMLViewer is 1344 x 708

Why are you disabling and then, supposedly, re-enabling the HTMLViewer control?

To try and get it to work. This topic has come up before in previous threads and I saw that suggestion there. It seems a little silly to do that but I thought it was worth a shot. :slight_smile:

I just tried putting this code on the Open event handler of an HTMLViewer:

Me.LoadURL("http://www.dombrov.com/")

I get the scroll bar on both OS X 10.9.2 and Windows 8.1.

What OS are you using? If Windows, what HTMLViewer.Renderer are you using? Does changing it have any effect?

Like Paul, I also got a scroll bar using just
Me.LoadURL(“http://www.dombrov.com/”)
in the open event of an HTMLViewer.
*Note: I think Paul has a typo. You don’t need to refer to HTMLViewer1 if you put the code in its own open event.
I’m on Mac 10.9

Yes, I did. I’ve fixed it.

I changed the Renderer from Native to Webkit and that did the trick. I’m still fairly new to this IDE so not sure I fully know the difference of those options but I’m very pleased that it worked. Thanks gentlemen, I appreciate the helpful responses.

Native uses the system Internet Explorer renderer. WebKit uses an embedded version of WebKit.

http://documentation.xojo.com/index.php/HTMLViewer.Renderer

FWIW, I used the Native renderer on Windows 8.1 and it worked, but maybe you have an older version of Windows with an older version of IE that could be causing a problem.

I am also using Windows 8.1. and have IE 11 which I believe is the latest so I probably need to figure out why this is happening with the native renderer. Could it be something with the settings in IE? I also have Google Chrome installed, would that have anything to do with it? I will also try this from my Windows 7 computer and will post my results.

I noticed the renderer is only applicable to Windows but I definitely want to run this app on a Mac. Should I be concerned with using this control on a Mac? I suppose the obvious answer is to test it from a Mac which I hope to be able to do soon. Thanks again …

If you want the same experience across all three platforms, I would recommend always using the WebKit renderer for your HTMLViewers… I believe the IE engine actually uses an older version to do the rendering (regardless of what is installed on your machine and it is not a fault of Xojo it is just the way the IE engine works)…

I’m not sure if the old compatibility mode still exists or is set in IE11
http://www.realsoftwareblog.com/2011/01/changing-htmlviewer-rendering-mode-on.html

http://msdn.microsoft.com/en-us/library/dn384051(v=vs.85).aspx

It still kind of does, but it looks like they are trying to get rid of it…

OS X always uses WebKit.