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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent Help Needed drawing a Line around a List View

Status
Not open for further replies.

redav

Programmer
Mar 20, 2001
55
GB
The code below draws a line around the listview BUT does not incorporate the Headers.

How do I get it to draw a line around the entire listview including the headers.


private void button1_Click(object sender,System.EventArgs e)
{

Graphics g = ListView1.CreateGraphics();
Pen p = new Pen(Color.Black,.5F);
Pen eraser = new Pen(Color.Red);
g.DrawRectangle(eraser, 0, 0, ListView1.Width-1, ListView1.Height-1);

}
 
Don't you want the parent window to draw the line in itself around the list view? Then you can't get the graphics object from the list view right?

-pete
 
I'm trying to creating a control for the listview in order for me to change the color of the column headers and the border of the list view control.

I cannot get to the header to color it.

What additional code do I need to add to do this.

Thanks
Redav

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top