I can't find a solution to my problem.
Trying to use a function. I want to pass a PictureBox control to this function. I want this funciton to modify the PictureBox's graphics (Lines, Boxes, Circles, etc.) and then to return the PictureBox back to the form with it's new graphics.
This is what I thought should work. Any help, or solutions?
VB Code:
Option Explicit Function Update_Graphics(PicBox As Object) As Object 'Also have tried.. As PictureBox PicBox.Cls 'This does not draw PicBox.Scale (0, 0)-(50, 50) PicBox.Line (0, 0)-(50, 50) Set Update_Graphics = PicBox End Function Private Sub Command1_Click() Dim objGraphics As PictureBox Set objGraphics = Picture1 Set Picture1 = Update_Graphics(objGraphics) ' Picture1.Cls ' This draws fine ' Picture1.Scale (0, 0)-(50, 50) ' Picture1.Line (0, 0)-(50, 50) End Sub
Thanks!




Reply With Quote