Code Red > .NET

Graphics.DrawLine on Panel

(1/2) > >>

T.Willey:
I can't seem to draw a line on a panel on my form.  I have read he MSDN site, and got some code that they claim to work, but it won't work for me.  And the other sites that I have seen, seem to do it the say way.  Why can't I get this to work?

Thanks in advance.


--- Code: ---using ( Graphics tempGphc = MPnl.CreateGraphics() ) {
tempGphc.DrawLine( new Pen( Color.Black ), tempPt.X + 90, StartY - 47, tempPt.X + 90, tempPt.Y + 47 );
}

--- End code ---
Couldn't even get it to draw it on my form.

--- Code: ---using ( Graphics tempGphc = this.CreateGraphics() ) {
tempGphc.DrawLine( new Pen( Color.Black ), 5, 455, 300, 455 );
}

--- End code ---

Draftek:
Try making the x,y of the start point 0,0

T.Willey:

--- Quote from: Draftek on October 09, 2008, 04:20:59 PM ---Try making the x,y of the start point 0,0


--- End quote ---
That didn't work.  If I can't get this to work, then I will just have to use another way to separate my items.

It's Alive!:
on my way out the door.. maybe something here will help?
http://www.theswamp.org/index.php?topic=20620.msg250780#msg250780

T.Willey:
I couldn't get it to work the way I wanted it to, so I just create a group box per drawing to break up the dialog a little nicer.

Navigation

[0] Message Index

[#] Next page

Go to full version