How to Hide a WebListbox Scrollbar?

Is there a way to hide the weblistbox scrollbar?

Any idea to make a workaround?

Tks

Alex

Place a rectangle the same color as the background over it.

However, I would not recommend it. You never know which machine will access your app, and some users do not have mice equipped with a wheel. Then they need the scrollBar knob or the arrows to move the rows.

@Michel Bujardet

I’m trying this…

dim st() As String st.append("var SB = document.getElementById('" + me.controlID + "').getElementsByClassName('scrollbar vertical');") st.append("SB.style.display=""none"";") me.ExecuteJavaScript(Join(st))

Bug i’m getting an error…

Could not execute returned javascript: undefined is not an object (evaluating ‘SB.style.display=“none”’)

I don’t think your JavaScript skills are strong enough to be hacking the web framework. getElementsByClassName would return an array of the elements that use that class name. You would have to loop through it to use it.

Use Inspect Element on a WebListBox and break it down to find out what the scrollbar is called, select just the scrollbar of the WebListBox by ID, and make it hidden. I’m not running the IDE right now, so I don’t have more specifics, but that’s roughly step by step on how to get it.

[quote=255387:@Alexandre Cunha]@Michel Bujardet

I’m trying this…

dim st() As String st.append("var SB = document.getElementById('" + me.controlID + "').getElementsByClassName('scrollbar vertical');") st.append("SB.style.display=""none"";") me.ExecuteJavaScript(Join(st))

Bug i’m getting an error…

Could not execute returned javascript: undefined is not an object (evaluating ‘SB.style.display=“none”’)[/quote]

You should look at the Xojo code with the browser developer’s tools. I believe visibility is not addressed by a style.

Once again, I should warn you against hiding the scrollbar, that will make it impossible for some devices to scroll.

You should consider showing the scrollbar when the pointer hovers the listbox.

http://www.w3schools.com/jsref/met_document_getelementsbyclassname.asp
http://www.w3schools.com/cssref/pr_class_visibility.asp
To manage visibility when the mouse enters the ListBox :
http://www.w3schools.com/jsref/event_onmouseover.asp or use the MouseEnter/MouseExit Xojo events.

I found this old topic, and have the same problem: I want to hide the scrollbar. Is there a new way with Xojo to do it?

Or still only with some tricks like javascript or a picture about the listbox?

What I posted above is still valid.

Well, let the chaos ensue:

Sub Shown() Handles Shown
  me.ExecuteJavaScript("document.getElementById('" + me.ControlID + "_vScroll').remove();")
End Sub

I would not remove _vscroll outright. Playing on it’s visibility is probably less dangerous.

Sub Shown() Handles Shown me.ExecuteJavaScript("document.getElementById('" + me.ControlID + "_vScroll').style.visibility='hidden'") End Sub

my solution: I limited the datas for the listbox to a maximum, and made the height of listbox greater than the maximums lines of the listbox. not a pretty way, but the scrollbar is gone. :slight_smile:

So you have not even tried what Tim and I posted after you asked ? Thank you, really. Next time I won’t waste time trying to help :confused:

Psh, he can change his mind if he wants to. It’s not like it took very long to come up with element.remove()

Hi Tim and Michel. Another guy resurrecting and old thread, but hey, I like zombies… :slight_smile:

And it’s for a noble cause: I only want to thank you and let you know that your efforts were not in vain. :wink: I used the scrollbar visibility trick and it works great. Continue to post helping tips, you never know when it’ll be useful.

Cheers!