# How to hide horizontal scrollbar in StyledTextCtrl?

**URL:** <https://www.ruby-forum.com/t/how-to-hide-horizontal-scrollbar-in-styledtextctrl/160131>\
**Category:** wxRuby\
**Created:** [February 12, 2009, 12:47am UTC](https://www.ruby-forum.com/t/how-to-hide-horizontal-scrollbar-in-styledtextctrl/160131 "2009-02-12T00:47:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/7cd45c/32.png) [@zzhan](https://www.ruby-forum.com/u/zzhan)\
**Post date:** [February 12, 2009, 12:47am UTC](https://www.ruby-forum.com/t/how-to-hide-horizontal-scrollbar-in-styledtextctrl/160131/1 "2009-02-12T00:47:53Z")

</div>

Hi,

The StyledTextCtrl sample (samples\scintilla.rb) shows the horizontal  
scrollbar by default, even there is no text in the editor. How to turn  
off that option?

PS. The doc for StyledTextEvent is missing,  
[http://wxruby.rubyforge.org/doc/styledtextevent](http://wxruby.rubyforge.org/doc/styledtextevent)

Thanks,  
Zhimin

---

<div class="post-metadata">

**Author:** ![zzhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/7cd45c/32.png) [@zzhan](https://www.ruby-forum.com/u/zzhan)\
**Post date:** [February 12, 2009, 10:17am UTC](https://www.ruby-forum.com/t/how-to-hide-horizontal-scrollbar-in-styledtextctrl/160131/2 "2009-02-12T10:17:23Z")

</div>

Zhimin Z. wrote:

> The StyledTextCtrl sample (samples\scintilla.rb) shows the horizontal  
> scrollbar by default, even there is no text in the editor. How to turn  
> off that option?

stc.use\_horizontal\_scroll\_bar = false

> PS. The doc for StyledTextEvent is missing,  
> [http://wxruby.rubyforge.org/doc/styledtextevent](http://wxruby.rubyforge.org/doc/styledtextevent)

Thanks for pointing out the broken link, it should be to:

[http://wxruby.rubyforge.org/doc/styledtextevent.html](http://wxruby.rubyforge.org/doc/styledtextevent.html)

alex

---

<div class="post-metadata">

**Author:** ![zzhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/7cd45c/32.png) [@zzhan](https://www.ruby-forum.com/u/zzhan)\
**Post date:** [February 12, 2009, 11:37pm UTC](https://www.ruby-forum.com/t/how-to-hide-horizontal-scrollbar-in-styledtextctrl/160131/3 "2009-02-12T23:37:38Z")

</div>

Alex F. wrote:

> stc.use\_horizontal\_scroll\_bar = false

Thanks, Alex.

What I really wanted was to show horizontal scroll bar as needed,  
following your reply, I added

```
  set_scroll_width(100)

```

That seemed solved my problem.

The default scroll width (calling get\_scroll\_width) was set 2000.

Regards,  
Zhimin
