Good day all
I need to find a way of changing the bordercolour of a picturebox to another colour other than black.
Is that possible??
PS. Note the spelling of colour!!!
heehee
Printable View
Good day all
I need to find a way of changing the bordercolour of a picturebox to another colour other than black.
Is that possible??
PS. Note the spelling of colour!!!
heehee
You can change the ForeColor and BackColor, but there is no BorderColor property.
A workaround might be to put your Picture box in a Label, and size the Label so that it hugs the outline of the Picture box. Then by chaning the Label's forecolor you should be able to simulate a Picturebox's BorderColor.
Sorry did not see that, but if you make the picturebox "Flat" it looks like its got a border. Would you beable to change that?.
By change that I assume you mean the color. Nope. We are back to the same old BackColor ForeColor only choice which affects the entire control.Quote:
but if you make the picturebox "Flat" it looks like its got a border. Would you beable to change that?.
Unfortunately, you cannot change the BorderColor. As a work around, change the BorderStyle to flat, and draw your own border.
This code should get you starting on drawing the outside border. I used black as the colour, but you can change it to whatever you want.
You'll also need to draw the inside border as well.
VB Code:
Private Sub Picture1_Paint() Dim x1 As Integer Dim y1 As Integer x1 = Screen.TwipsPerPixelX y1 = Screen.TwipsPerPixelY Picture1.Line (0, 0)-(Picture1.ScaleWidth, 0), vbBlack Picture1.Line (0, 0)-(0, Picture1.ScaleHeight), vbBlack Picture1.Line (Picture1.ScaleWidth - x1, 0)-(Picture1.ScaleWidth - x1, Picture1.ScaleHeight), vbBlack Picture1.Line (0, Picture1.ScaleHeight - y1)-(Picture1.ScaleWidth, Picture1.ScaleHeight - y1), vbBlack End Sub
using subclass and intercept WM_PAINT to draw your own borderQuote:
Originally posted by Phobbos
Good day all
I need to find a way of changing the bordercolour of a picturebox to another colour other than black.
Is that possible??
PS. Note the spelling of colour!!!
heehee