Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I inset text into a panel using codebehind

Status
Not open for further replies.

yongbum

Programmer
Dec 15, 2005
48
IL
Hi I have a panel with a background image and I want to superimpose some text on this using codebehind, how do I do this. I've seen InnerHTML or InnerText and this seems to be what I need. What's the Panel attribute equivelent.

Thanks
 
You could simply add a Literal to the Panel e.g.
Code:
        Dim l As New Literal
        l.Text = "Hi"
        Panel1.Controls.Add(l)
although I guess it depends what you are actually wanting to do which will determine if this is the best method. For example, if you are want to add a kind of copyright watermark over the Image, then it may be best to use GDI+ and actually append that text to the image (so that user's can't simply navigate directly to the image and bypass the Text you have written over the image in the Panel).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks ca8msm a literal sounds ok, will I still see the image - that is can I make it transparent?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top