Instead of using the click event of a button, use the Paint event of the form. It will give you a PaintEventArgs argument which contains a Graphics object to draw in.Use the code already provided. It should work. Success!
Public Class Form1
Dim MyGraphics As Graphics
Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
MyGraphics = e.Graphics
MyGraphics.DrawLine(Pens.Black, 0, 0, 50, 50)
MyGraphics.DrawLine(Pens.Green, 50, 50, 75, 75)
Dim myPen As New Pen(Color.Red, 5.0F)
MyGraphics.DrawLine(myPen, 75, 75, 150, 100)
myPen.Width = 7.0F
myPen.Color = Color.LightSteelBlue
MyGraphics.DrawLine(myPen, 150, 100, 200, 375)
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"