Link to home
Start Free TrialLog in
Avatar of pbr-streetgang
pbr-streetgang

asked on

is it possible to draw an Icon in a vb textbox

is it possible to draw an Icon in a vb textbox
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Could you use a rich text box instead?
ASKER CERTIFIED SOLUTION
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Textboxes do not support graphics.
As mentioned, a RichTextbox may be sufficient, or you may want to create your own, which is actually pretty easy:

* Add a usercontrol to your project.
* Drop an image control on the user control.
* Drop a textbox control on the user control.
* Run the User control wizard.
* Select all properties, methods and events you want to support.
* Map all user control properties to the corresponding "child" controls.
* Finalize the wizard

* Modify the code of the UserControl_resize so that the image control is attached to the left of the user control (or wherever you want it) and the textbox fills in the rest of the control.
* Optionally add a special picture to the user control's toolbox image.

Save this user control as something like IconTextBox.

Add this user control to your form as though you were adding a textbox.
That form's code posted does it. Any progress?
Hi again, do you need more help?
Just ask.