473,385 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
Nov 21 '05 #1
3 2476
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(DesignerSerializat inoVisibility, 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!
"Rich" wrote:
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

Nov 21 '05 #2
Dim g as graphics = anyform.creategraphics
or
Dim g as graphics = anycontrol.creategraphics
Nov 21 '05 #3
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!
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Marc Ouellette | last post by:
Hi All. In the code below it will output the text string that is using the text from txtTextToDraw.Text using the font properties of the lblFont. Then problem is that not matter the font size...
1
by: John | last post by:
I'm trying to use the DrawText() method to draw some very long string text on the Panel with AutoScroll enabled. However, for some unknown reasons, I could not trigger the ScrollBar to show up. ...
0
by: melanieab | last post by:
Hi again, I'm trying to draw a digital clock in the corner of a picturebox whenever a particular tabpage is in focus. I either need to be able to make the clock keep real time (I can get it to...
1
by: Joao | last post by:
Hi, I'm trully excited to use VB.NET's PrintDocument to make my printouts. On them I draw strings, images and lines. All perfect, if I invoke the Print or the PrintPreview one time per run. At...
2
by: Martin | last post by:
Hello All, I've created a WinForm control and everything is OK except the look of the font on my control. protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); ...
3
by: Allen | last post by:
I've got a control that you can resize the contents of one of the text fields inside it. When the contents are resized to smaller than the text, I remove some of the end of the text and...
3
by: =?Utf-8?B?SlIx?= | last post by:
I would like to add text to an image. I have tried to use DrawString and it works on some images but on others it is very very small. I am pretty sure it has something to do with the size of the...
2
by: ChrisNightingale | last post by:
Hi everybody, I have an odd issue which I'm not sure how to resolve. I'm basically implementing a print mechanism which takes a series of controls and reproduces them on a print document. So...
3
by: Larry | last post by:
I'm sure I've missed the obvious, but when I define a custom color, my DrawString call from my Paint event doesn't seem to draw anything at all. void btnNav_Paint(object sender, PaintEventArgs...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.