Picture in TextBox background

Hi, I would like to put a picture in a textbox background, anyone tells me if it can be done. The reason is I need to put some photo (.jpg image) in a very large text box so that my text box could look attractive while displaying text.
Would be grateful if someone give suggestion how to do that.




  • seancampbellseancampbell Pennsylvania, USA
    I read around a few places to gain some understanding. The Windows Forms Textbox has a BackgroundImage property that you cannot set in the properties windows but will show up in the Intellisense. This property does not appear to draw anything, and anyone who has tried to draw one or make the backcolor Transparent says that once you type text in it will remove the Backimage/Transparency (and you cannot set it to transparent in the Windows Form Designer property box).

    That said, every solution out there appears to be creating your own Subclass of Textbox that draws the image properly and is moderate to advanced code.

    If you want to do something like that, here's suggestion on where to start:

    This is in C#, if you need, I can translate it,

    Sean Campbell
  • i have seen it as you has suggested, its exactly what i want. i would be very grateful if you could translate this code for me so that i could use it on my vb.net 2003 since i don't have deep knowledge in .net.

    thank you very much and awaiting your help.

  • seancampbellseancampbell Pennsylvania, USA
    Sorry I haven't had the time to finish converting this Zela,

    I will take a crack at finishing it this weekend,

    Sean C
  • Note Only For Visual Basic 9

    If You Use RichTextBox You Can Do Whatever You Want...
  • I am using vb.net 2003 and .xml as database, i am still waiting seancampbell help here

  • seancampbellseancampbell Pennsylvania, USA

    I converted the source files for the textbox to VB and included a form with an example of adding the Textbox dynamically on the load function.

    Looking at the original project, you could choose to include the DLL compiled from C# and use that in a VB Project (there is an example in the original Source project from the codeproject link I sent) in case you prefer to use the original.

    I used a code converter here: http://www.developerfusion.com/tools/convert/csharp-to-vb/ to convert the source in both win32.cs and AlphaTextBox.cs (I had to change a couple things after I converted it to get it to run, namely changing UInteger to Integer and removing the Namespace declaration)

    Happy coding, let me know when you download that so I can remove it from my server
  • I had download your thing now and thanks a lot for that. I'll see and try to make it work i hope.
    Theres another thing I wonder if you could give suggestion or help me on this. This small application i made with this vb.net 2003 I build an installation package using smart install maker program but this package required dotnet 1.1 to run. Is there anyway I include the dotnet 1.1 necessary file along with the setup program i made with this Smart Install maker during building the installation package or the dotnet has to be install separately each time when installing the software.
    Would be grateful if you could throw a light on this matter.

    Thank you.

  • Thanks a lot, i had download your code and see it at home, hope it would work.

    Theres another thing wonder if you could give suggestion. This small sofware i made using vb.net 2003 which use .xml database, i create a installation package using smart install maker, but the software requires dotnet 1.1 to run. Whenever install the software I have to install the dotnet version separately. Is there any way to build the whole necessary file using install maker at one go so that all the necessary file for running my software could be install at one time.

    Would be grateful if you could throw some light on this.

    Thanks anyway.

  • seancampbellseancampbell Pennsylvania, USA
    Believe it or not, I have never deployed software through an installer package.

    Sometimes, When I install a new piece of software, it checks for .Net Framework and will install the necessary version of .Net if it isn't already installed. So I assume that this is do-able, I will look around for more information on this subject for you.

    -Sean Campbell
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!