When drawing a line in the ScreenDC (eg. API MoveTo LineTo)
is there anyway to set the color?
There is no forecolor property for the Screen object.
API CreatePen also doesn't appear to work.
Thanks
David
Printable View
When drawing a line in the ScreenDC (eg. API MoveTo LineTo)
is there anyway to set the color?
There is no forecolor property for the Screen object.
API CreatePen also doesn't appear to work.
Thanks
David
Did you do something like this?
I tried that myself, and it drew a red line on my screen like I expected.VB Code:
Dim DC As Long, hPen As Long, hOldPen As Long DC = GetDC(0) hPen = CreatePen(PS_SOLID, 1, vbRed) hOldPen = SelectObject(DC, hPen) MoveToEx DC, 200, 150, 0 LineTo DC, 600, 450 DeleteObject SelectObject(DC, hOldPen) ReleaseDC 0, DC
Lookes like my code, but mine just draws a black line.
Tried changing colors and still black.
I have a picbox showing on top of the screen, draw in picboxdc OK, then change to screendc and draw another line still on top of picbox. Only getting black lines - - color won't change so something else must be wrong.
Thanks for quick feedback.
David