Textbox BackgroundImage property

  • Thread starter Thread starter John
  • Start date Start date
J

John

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
 
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
-----------
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
 
Back
Top