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
Could you use a rich text box instead?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
Hi,
Try this sample apps
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=27787&lngWId=1
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=28892&lngWId=1
Regards
Sridhar
Try this sample apps
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=27787&lngWId=1
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=28892&lngWId=1
Regards
Sridhar
That form's code posted does it. Any progress?
Hi again, do you need more help?
Just ask.
Just ask.