dplambert
asked on
Raised 3D Effect for PictureBox
Probably my final question for a while in this topic area...
For a PictureBox control, how can I give it a "raised" 3D effect? If you make it 3D instead of Flat for Appearance, it's always "sunken" into the form. There has to be an easy way to do this.
For a PictureBox control, how can I give it a "raised" 3D effect? If you make it 3D instead of Flat for Appearance, it's always "sunken" into the form. There has to be an easy way to do this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It is also possible to use DrawEdge API in Paint event of the Form. Let me know if you want code sample (uses DrawEdge, InflateRect, GetDC).
Good point, Ameba.
This should work better (without the API):
Private Sub Form_Paint()
Picture1.Line (0, 0)-(Picture1.ScaleWidth, Picture1.ScaleHeight), vbWhite, B
Picture1.Line (-10, -10)-(Picture1.ScaleWidth - 10, Picture1.ScaleHeight - 10), vbBlack, B
End Sub
(Make sure that the picturebox has the autoredraw property set to True.)
This should work better (without the API):
Private Sub Form_Paint()
Picture1.Line (0, 0)-(Picture1.ScaleWidth, Picture1.ScaleHeight), vbWhite, B
Picture1.Line (-10, -10)-(Picture1.ScaleWidth - 10, Picture1.ScaleHeight - 10), vbBlack, B
End Sub
(Make sure that the picturebox has the autoredraw property set to True.)
ASKER
Why isn't there a property setting for this? Something real simple?
The reason is because it was not part of the original design.
If you want, you can simply create your own picturebox to support such a property by creating a new user control and adding more styles to the borderstyle setting...then you can call it a DPLPictureBox!
If you want, you can simply create your own picturebox to support such a property by creating a new user control and adding more styles to the borderstyle setting...then you can call it a DPLPictureBox!