Click here to Skip to main content
15,921,113 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Windows service and dependencies Pin
KreativeKai10-Oct-08 9:31
professionalKreativeKai10-Oct-08 9:31 
QuestionQuestion about objects and forms Pin
sa_runner10-Oct-08 7:57
sa_runner10-Oct-08 7:57 
AnswerRe: Question about objects and forms Pin
Wendelius10-Oct-08 8:06
mentorWendelius10-Oct-08 8:06 
GeneralRe: Question about objects and forms Pin
sa_runner12-Oct-08 18:00
sa_runner12-Oct-08 18:00 
GeneralRe: Question about objects and forms Pin
Wendelius13-Oct-08 5:17
mentorWendelius13-Oct-08 5:17 
Questionhow to draw a line on a picture box Pin
flamingo210-Oct-08 3:12
flamingo210-Oct-08 3:12 
AnswerRe: how to draw a line on a picture box Pin
Thomas Stockwell10-Oct-08 4:29
professionalThomas Stockwell10-Oct-08 4:29 
AnswerRe: how to draw a line on a picture box Pin
C1AllenS10-Oct-08 4:55
C1AllenS10-Oct-08 4:55 
Hello,

You can try the given code.

BEGIN CODE

<br />
    Dim MD, MU As Point<br />
<br />
    Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown<br />
<br />
        MD = e.Location<br />
<br />
    End Sub<br />
<br />
    Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove<br />
<br />
        If e.Button = Windows.Forms.MouseButtons.Left Then<br />
<br />
            MU = e.Location<br />
            DrawLine()<br />
        End If<br />
<br />
    End Sub<br />
<br />
    Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp<br />
<br />
        MU = e.Location<br />
        DrawLine()<br />
<br />
    End Sub<br />
<br />
    Public Sub DrawLine()<br />
<br />
        Dim g As Graphics<br />
        g = Me.PictureBox1.CreateGraphics<br />
        g.Clear(Me.PictureBox1.BackColor)<br />
        g.DrawLine(Pens.Blue, MD, MU)<br />
        g.Dispose()<br />
<br />
    End Sub<br />


I hope this will help.

Regards,

Allen Smith


ComponentOne LLC
www.componentone.com

GeneralRe: how to draw a line on a picture box Pin
flamingo210-Oct-08 9:49
flamingo210-Oct-08 9:49 
Generalhow to draw a rectangle on a pictureBox Pin
flamingo210-Oct-08 20:05
flamingo210-Oct-08 20:05 
Questionweb browser Pin
Shazz Rock10-Oct-08 0:45
Shazz Rock10-Oct-08 0:45 
AnswerRe: web browser Pin
jzonthemtn10-Oct-08 3:52
jzonthemtn10-Oct-08 3:52 
GeneralRe: web browser Pin
LloydA11110-Oct-08 8:37
LloydA11110-Oct-08 8:37 
QuestionControls and threads problem Pin
ambio9-Oct-08 22:52
ambio9-Oct-08 22:52 
AnswerRe: Controls and threads problem Pin
Dave Kreskowiak10-Oct-08 1:04
mveDave Kreskowiak10-Oct-08 1:04 
GeneralRe: Controls and threads problem Pin
ambio10-Oct-08 4:40
ambio10-Oct-08 4:40 
GeneralRe: Controls and threads problem Pin
Dave Kreskowiak10-Oct-08 5:14
mveDave Kreskowiak10-Oct-08 5:14 
GeneralRe: Controls and threads problem Pin
ambio12-Oct-08 22:34
ambio12-Oct-08 22:34 
GeneralRe: Controls and threads problem Pin
Dave Kreskowiak13-Oct-08 1:27
mveDave Kreskowiak13-Oct-08 1:27 
GeneralRe: Controls and threads problem Pin
ambio13-Oct-08 2:13
ambio13-Oct-08 2:13 
QuestionTransaction AS400 Pin
helelark1239-Oct-08 20:32
helelark1239-Oct-08 20:32 
AnswerRe: Transaction AS400 Pin
Ashfield9-Oct-08 21:34
Ashfield9-Oct-08 21:34 
GeneralRe: Transaction AS400 Pin
Mycroft Holmes9-Oct-08 21:41
professionalMycroft Holmes9-Oct-08 21:41 
GeneralRe: Transaction AS400 Pin
Wendelius10-Oct-08 7:01
mentorWendelius10-Oct-08 7:01 
AnswerRe: Transaction AS400 Pin
Kschuler10-Oct-08 6:41
Kschuler10-Oct-08 6:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.