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

Visual Basic

 
GeneralRe: curriculum vitale / resume loader Pin
jhyn11-Oct-08 21:29
jhyn11-Oct-08 21:29 
AnswerRe: curriculum vitale / resume loader Pin
Wendelius12-Oct-08 0:16
mentorWendelius12-Oct-08 0:16 
GeneralRe: curriculum vitale / resume loader Pin
jhyn12-Oct-08 19:19
jhyn12-Oct-08 19:19 
GeneralRe: curriculum vitale / resume loader Pin
jhyn21-Oct-08 0:57
jhyn21-Oct-08 0:57 
GeneralRe: curriculum vitale / resume loader Pin
Wendelius21-Oct-08 7:34
mentorWendelius21-Oct-08 7:34 
GeneralRe: curriculum vitale / resume loader Pin
jhyn21-Oct-08 19:18
jhyn21-Oct-08 19:18 
GeneralRe: curriculum vitale / resume loader Pin
Wendelius22-Oct-08 7:25
mentorWendelius22-Oct-08 7:25 
Questionrectangle in picture box Pin
flamingo210-Oct-08 20:38
flamingo210-Oct-08 20:38 
am trying to draw rectangle but it is drawn just with a single click (with different lengths and widths) also it is going out of pictureBox area But i want it to start from where mouse key is pressed and end where mouse key is released. i think there is something wrong with my quardinate. Waiting for reply.
Thanks

[code]

Dim x1, y1, x2, y2 As Integer
Dim MD, MU As Point
Dim mywidth As Integer
Dim drawtool As String
Dim drawpen As Pen
Dim g As Graphics

Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
MD = e.Location
x1 = MD.X
y1 = MD.Y
End Sub


Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
If e.Button = Windows.Forms.MouseButtons.Left Then
MU = e.Location
x2 = MD.X
y2 = MD.Y
DrawRectangle()
End Sub


Public Sub DrawRectangle()
gr = PictureBox1.CreateGraphics
Dim solidColorBrush As SolidBrush = New SolidBrush(Color.Red)
Dim coloredPen As Pen = New Pen(solidColorBrush)
coloredPen.Width = 3
coloredPen.Color = Color.Blue

Dim drawArea2 As Rectangle = New Rectangle(x1, y1, x2, y2)
gr.DrawRectangle(coloredPen, drawArea2)
gr.Dispose()

End Sub

[End code]
QuestionWindows service and dependencies Pin
KreativeKai10-Oct-08 8:33
professionalKreativeKai10-Oct-08 8:33 
GeneralRe: Windows service and dependencies Pin
jzonthemtn10-Oct-08 8:43
jzonthemtn10-Oct-08 8:43 
GeneralRe: Windows service and dependencies Pin
KreativeKai10-Oct-08 8:47
professionalKreativeKai10-Oct-08 8:47 
GeneralRe: Windows service and dependencies Pin
jzonthemtn10-Oct-08 8:50
jzonthemtn10-Oct-08 8:50 
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 
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 

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.