I have an HMI based on Proficy Ifix 5.5 which contains a header, footer, and main screen. the footer contains a panel of navigating buttons which change the screens of the main screen. there are approximately 50 buttons, which I have had to modify one by one on enough occasions that I've got keyboard marks permanently embedded in my forehead from repeat concussive therapy.
I am looking for an elegant solution which names the button (which is a .jpg) the same name as the screen (for instance BCP) and the VB script can compare the button name and compare it to the .grf
fyi: the GlobalPicFileCurrent is the variable when the picture initializes to hold the name of the current picture. variations head stand for the header, foot for footer, and back is the previous picture to enable a back button which is 50% effective.
I am looking for an elegant solution which names the button (which is a .jpg) the same name as the screen (for instance BCP) and the VB script can compare the button name and compare it to the .grf
Code:
Private Sub BCP_Click()
On Error GoTo ErrorHandler
Dim x As String
x = Me.Name 'should be the button name "BCP"
If x <> user.globalPicFileCurrent.CurrentValue Then
replacepicture "bcp", user.globalPicFileCurrent.CurrentValue 'REPLACEPIC * N3PUMPS
user.GlobalHeadBack.CurrentValue = user.GlobalHeadCurrent.CurrentValue
user.GlobalFootBack.CurrentValue = user.GlobalFootCurrent.CurrentValue
Else
End If
Exit Sub
ErrorHandler:
HandleError
End Sub