can g.DrawString draw text on top of a label control? any control?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I need to draw some text on a form. No problem
....
e.Graphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat)

My problem is that I want to draw the text on top of some label controls.
Is there a way to do this using the Graphics DrawString method? Is there a
way to do this using another method?

Thanks
 
I found the answer to this question, and previous questions from yesterday.

First, I want to extend my thanks to Qwert who gave me the answer to my
question about creating transparent labels by creating a user control. Many
thanks Qwert. Your solution worked perfectly. Since I don't have any real
experience to speak of with GDI+, there is no way I would know of the correct
syntax for something like this like:

<Bindable(True), Category("Appearance"), _
DesignerSerializationVisibility(DesignerSerializatinoVisibility, Visible), _
Browsable(True)>

Well, I created my transparent label and then created a User Control form to
put it on. Then I planted all that on my main form. Works Great!
 
Dim g as graphics = anyform.creategraphics
or
Dim g as graphics = anycontrol.creategraphics
 
sorry just read the next message.
You don't need the <attributes> bit.

Incidentally, you don't actually create a transparent usercontrol. What is
actually happening is that Windows generates a background colour equal to
the form your control is on. Try painting the form with a hatch or a
gradient fill and sees what happens!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top