# VBForums UtilityBank > UtilityBank - Components >  [VB6] IconTextBox

## baja_yu

This is a very simple component that adds an icon to the classic TextBox. Size of the icon is 24x24. 

Besides the standard events and properties you have the Icon property to set the icon itself. You also have IconClick and IconDblClick events that will be reaised if the icon is clicked. Standard Click/DblClick events apply to the textbox itself.

Because the icon is a picturebox superimposed on the textbox, the height od the control and therefore textbox are limited to standard size, and there's also no multiline. This doesn't work well with changing font sizes because of that. I whipped this up quickly so it might be added in a future version.

Any comments are welcome. Enjoy.

----------


## akhileshbc

Nice... :Thumb: 

I think you can add a watermark kind of text(like in Opera) as an additional property. So, if anyone wants to use it as a search box, it will be useful. Just a suggestion...  :Wink:

----------


## baja_yu

You mean like that 'ghost text', what ever it's called that appears in grey when the box is empty, saying like "Enter keywords here" and when you click or start typing it disappears? That would be a nice addition. I'll also work on option to align the icon to the left or right, and to allow vertical sizing to with the icon automatically adjusting to the height.

I just made this real quick as a response to a thread in VB Classic forum, didn't think much about additional features at the time.

----------


## akhileshbc

> You mean like that 'ghost text', what ever it's called that appears in grey when the box is empty, saying like "Enter keywords here" and when you click or start typing it disappears? That would be a nice addition. I'll also work on option to align the icon to the left or right, and to allow vertical sizing to with the icon automatically adjusting to the height.


Yep.... :Thumb:

----------

