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

Creating a small graphic area on a form

Status
Not open for further replies.

CaKiwi

Programmer
Apr 8, 2001
1,294
US
I need to create a small graphics area on a form in which I can display a plus sign that I can move around. So far I have a picturebox on my form and from what I have read so far it looks like I need a graphic control linked to it somehow. A simple example would be greatly appreciated.

CaKiwi
 
This is what I did. I have a picturebox called picCursor

Dim img As New Bitmap(picCursor.Width, picCursor.Height)
Dim g As Graphics = Graphics.FromImage(img)
Dim x As Integer = (picCursor.Width / 2)
Dim y As Integer = (picCursor.Height / 2)
g.DrawLine(Pens.Black, x, y + 5, x, y - 5)
g.DrawLine(Pens.Black, x - 5, y, x + 5, y)
picCursor.Image = img


CaKiwi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top