Quantcast
Channel: GE Intelligent Platforms e-Forum
Viewing all articles
Browse latest Browse all 2516

Passing a control name in VB code

$
0
0
Hi,

I have created a rectangle on the screen called Rect1 using Insert Shapes. I want to pass this control through to a sub so I can then access its foregroundcolor property in the code.

So for example I have an event control that executes on change of a historical tag.

Code:

Private Sub OptAGMChangeColor_DataChange(ByVal DataValue As Variant, ByVal TimeStamp As Date, ByVal Transition As Long, ByVal Reserved As Variant)

    tagName = rect1.Name
    Call changeGMLastChangedColor(tagName)
   
End Sub

This calls the sub changeGMLastChangedColor which then needs to allow me to use the foregroundcolor of the tagName

Code:

Public Sub changeGMLastChangedColor(ByVal tagName As String)

            tagName.ForegroundColor = vbGreen

    End Select


The code shown doesn't work, how can I change it to make it work?

Thanks
End Sub[/CODE]

Viewing all articles
Browse latest Browse all 2516


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