Dear All,
I am trying to limit the number of opened displayed areas on DeltaV operate? How can I do this.
Thanks,
In reply to Youssef.El-Bahtimy:
In reply to Mohd:
I would do something like this:
In user.fxg, toolbar, or schedule, create an event that fires every few seconds to evaluate the number of open pictures that are not the main picture.
You will get pictures like the alarm banner, toolbar etc. in the count, but you can account for these since they will be regular.
The code for this event should look like:
Dim objPicture As ObjectDim intCount As IntegerDim strPics As StringintCount = 0strPics = ""
'Look at each picture For Each objPicture In Application.Documents 'only check if a picture (not global or scheduler) If StrComp(objPicture.Page.ClassName, "Picture", vbTextCompare) = 0 Then
'is this not a main picture?
If Not (frsIsAMainPicture(objPicture)) Then intCount = intCount + 1 strPics = strPics + ";" + objPicture.Name
'if greater than 10 opened, close each one over 10
If intCount > 10 Then frsClosePic (objPicture.Name) End If End If End If
Next MsgBox intCount & ":" & strPics
For this example, I message box the number of pictures open and their object names. When the count goes above 10, I close the picture object. The collection of pictures adds in the order they are opened, so the first 2 to 5 or so are standard stuff like alarm banner, toolbar, etc (this is why I output the names...to determine when to start counting).
You can tweak the count, remove the msgbox, etc.