Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

Highlight Picturebox with rectangle

$
0
0
I am trying to put a rectangular line around my picturebox but it comes out strange. What am I doing wrong in my code?

Code:

Private Sub Slider1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Slider1.Click
       
        Dim objgraphics As Graphics
        objgraphics = Slider1.CreateGraphics

        objgraphics.DrawRectangle(System.Drawing.Pens.CadetBlue, _
                                  Slider1.Left - 1, Slider1.Top - 1, _
                                  Slider1.Width + 1, Slider1.Height + 1)
    End Sub


Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>