By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,584 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,584 IT Pros & Developers. It's quick & easy.

Textbox BackgroundImage property

P: n/a
Hello all,

I was wondering, does this property really exist in VB.NET 2003? Because
it's listed in Intellisense, but setting it doesn't seem to have the
slightest effect on the visual look of the control. I can set it for forms,
checkboxes, radiobuttons, buttons, pictureboxes, and it works for everything
except for textboxes. Does anyone know what's wrong?

For the record, when testing I simply put the following in the procedure
that handles the Form.Load event:

Dim BG As New Bitmap("C:\foobar.jpg")
Me.BackgroundImage = BG 'works
Checkbox1.BackgroundImage = BG 'works
RadioButton1.BackgroundImage = BG 'works
Textbox1.BackgroundImage = BG 'doesn't work, however:
If Textbox1.BackgroundImage Is Nothing Then
'the backgroundimage is not nothing when code reaches this point. Yet
the picture doesn't paint.
MsgBox("Failure")
End
End If
I hope you know some solution to this problem.

Thanks in advance,

John
---
Outgoing mail is certified Virus Free by AVG 6.0
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10-9-04
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Background image is a property of the control base class
which the textbox inherits from. Maybe this will help

http://www.dotnetspider.com/Technology/KBPages/411.aspx

Ken
-----------
"John" <I_*********@microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hello all,

I was wondering, does this property really exist in VB.NET 2003? Because
it's listed in Intellisense, but setting it doesn't seem to have the
slightest effect on the visual look of the control. I can set it for forms,
checkboxes, radiobuttons, buttons, pictureboxes, and it works for everything
except for textboxes. Does anyone know what's wrong?

For the record, when testing I simply put the following in the procedure
that handles the Form.Load event:

Dim BG As New Bitmap("C:\foobar.jpg")
Me.BackgroundImage = BG 'works
Checkbox1.BackgroundImage = BG 'works
RadioButton1.BackgroundImage = BG 'works
Textbox1.BackgroundImage = BG 'doesn't work, however:
If Textbox1.BackgroundImage Is Nothing Then
'the backgroundimage is not nothing when code reaches this point. Yet
the picture doesn't paint.
MsgBox("Failure")
End
End If
I hope you know some solution to this problem.

Thanks in advance,

John
---
Outgoing mail is certified Virus Free by AVG 6.0
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10-9-04

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.