# Add TextCtrl to toolbar

**URL:** <https://www.ruby-forum.com/t/add-textctrl-to-toolbar/139263>\
**Category:** wxRuby\
**Created:** [June 2, 2008, 12:54pm UTC](https://www.ruby-forum.com/t/add-textctrl-to-toolbar/139263 "2008-06-02T12:54:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![genericguy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5daacb/32.png) [@genericguy](https://www.ruby-forum.com/u/genericguy)\
**Post date:** [June 2, 2008, 12:54pm UTC](https://www.ruby-forum.com/t/add-textctrl-to-toolbar/139263/1 "2008-06-02T12:54:58Z")

</div>

Hi,  
How can I add a textctrl to a toolbar?  
I tried toolbar.add\_control(TextCtrl.new(self, ID\_ANY)), but that  
returns false and the control gets placed wherever.

Thanks

---

<div class="post-metadata">

**Author:** ![genericguy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5daacb/32.png) [@genericguy](https://www.ruby-forum.com/u/genericguy)\
**Post date:** [June 2, 2008, 12:59pm UTC](https://www.ruby-forum.com/t/add-textctrl-to-toolbar/139263/2 "2008-06-02T12:59:04Z")

</div>

Lucas Levin wrote:

> How can I add a textctrl to a toolbar?  
> I tried toolbar.add\_control(TextCtrl.new(self, ID\_ANY)), but that  
> returns false and the control gets placed wherever.  
> toolbar.add\_control( TextCtrl.new(toolbar, ID\_ANY) )

cheers  
alex
