473,394 Members | 1,852 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,394 software developers and data experts.

Graphics.DrawString Issue

Hi Everyone,
I have a small task, in which i need to design custom
Report Headers and Styles, for my applications, that i
make with C#.
How can i create a rectangle with Navyblue color filled in
it, and also inserted text "Report Title: Org Name: " in
that rectangle.
Finally i need to print(attach) this graphic at top of all
my Reports and Pages.

Thanks in Advance, and Happy New Year to All.
With Regards
Sunny
Nov 15 '05 #1
2 1779
Sunny,

First, you can use the MeasureString method on the Graphics instance to
figure out what the length of the bounding rectangle is. Once you have
that, you can use the DrawRectangles method to draw the navy blue rectangle,
and then the DrawString method to draw the string itself over the rectangle.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sunny" <gh**********@yahoo.com> wrote in message
news:06****************************@phx.gbl...
Hi Everyone,
I have a small task, in which i need to design custom
Report Headers and Styles, for my applications, that i
make with C#.
How can i create a rectangle with Navyblue color filled in
it, and also inserted text "Report Title: Org Name: " in
that rectangle.
Finally i need to print(attach) this graphic at top of all
my Reports and Pages.

Thanks in Advance, and Happy New Year to All.
With Regards
Sunny

Nov 15 '05 #2
Something to think about. If you are putting this same thing at the top of
all reports, why draw it at all? Just create an image for the top of your
reports and display the image instead.
"Sunny" <gh**********@yahoo.com> wrote in message
news:06****************************@phx.gbl...
Hi Everyone,
I have a small task, in which i need to design custom
Report Headers and Styles, for my applications, that i
make with C#.
How can i create a rectangle with Navyblue color filled in
it, and also inserted text "Report Title: Org Name: " in
that rectangle.
Finally i need to print(attach) this graphic at top of all
my Reports and Pages.

Thanks in Advance, and Happy New Year to All.
With Regards
Sunny

Nov 15 '05 #3

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

Similar topics

1
by: DrDevious | last post by:
Maybe I am doing something wrong but has anyone else here noticed a difference in the positioning of text between the Graphics.DrawString method and the Win32 GDI DrawText function? My text is...
0
by: twostepted | last post by:
Hello, This is a bit of a long post (sorry) but here is the jist of it: I've developed a Windows forms User Control marquee (auto-scrolling text like a readerboard). I'm trying to optimize it...
5
by: Charles A. Lackman | last post by:
Hello, I have created a complete PrintDocument and need to create an image from it. How is this done? e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality...
2
by: DazedAndConfused | last post by:
Is there a way to find the coordinates of x after using Graphics.DrawString? i.e. e.Graphics.DrawString("My Report", reportFont, reportBrush, x, y) x = the coordinates position of "t" in "My...
7
by: Michael Galvin | last post by:
I am trying to use Python to send to the printer a calender filled with a mix of text and simple graphics. I want to draw on the printed page something like a table with 6 rows and 7 columns to...
7
by: Peter Row | last post by:
Hi, I've started work on my own control some parts of which use standard controls, others I need to draw on my controls surface to get the display output I require, however.... I seem to be...
2
by: Tony Johansson | last post by:
Hello! If I use the DrawString below with object of StringFormat as the last object it works good. If I instead remove object StringFormat below as the last object of DrawString I get some rows...
6
by: Dilip | last post by:
Howdy Folks I have a display where the Graphics.DrawString function is called to display something. Since the text seems to be larger than its bounding rectangle, the call basically splits the...
10
by: anuking | last post by:
Hi, I made a tool that compares the texts from 2 richtextboxes and then marks the characters that are different in red. An option needs me to overlap these 2 text data to show the exact...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.