jtstanish Posted January 3, 2005 Posted January 3, 2005 :confused: How Can I Draw a Line On Top of a Label Control? :confused: Quote
Leaders Iceplug Posted January 3, 2005 Leaders Posted January 3, 2005 Why such big text? You create a Graphics object from the label, as in GFX = yourlabel.CreateGraphics() And then, you draw it, like GFX.DrawLine(0, 0, yourlabel.width, yourlabel.height) 'Draws a line going from the top left to the bottom right of the label. :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
jtstanish Posted January 3, 2005 Author Posted January 3, 2005 Thanks Sorry about the big text ... I was experimenting ... Thank You for your advice ... Why such big text? You create a Graphics object from the label, as in GFX = yourlabel.CreateGraphics() And then, you draw it, like GFX.DrawLine(0, 0, yourlabel.width, yourlabel.height) 'Draws a line going from the top left to the bottom right of the label. :) Quote
coldfusion244 Posted January 3, 2005 Posted January 3, 2005 Graphics Question Works great iceplug! Just tried it, never worked with graphics before... One question though, after I draw the line or fill a new backround, how do I return the label to it's original state? Quote -Sean
ThePentiumGuy Posted January 3, 2005 Posted January 3, 2005 You can: DIspose the graphics object or use an If statement to NOT draw the line ... for example If IwantToDrawTheLine Then e.graphics.drawline(......) End If jtstantish - also you can go in to the label's Paint event and draw the line: e.graphics.DrawLine(.....) and use Label1.Invalidate if the position of the line ever changes and you want to update it. -The Pentium Guy Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.