Graphics.DrawString Issue

  • Thread starter Thread starter Sunny
  • Start date Start date
S

Sunny

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