dOPC Client Toolkit Help file
TdOPCServerBrowser.FindByClassId Method
C++
public: __fastcall int FindByClassId(
    AnsiString ClassId
);
C#
public int FindByClassId(
    String ClassId
);
Visual Basic
Public Function FindByClassId(
    ClassId As String
) As Integer

FindByClassId searches the passed ClassId in the Items collection. Returns the index, if a match is found, otherwise 0.

procedure TForm1.Button1Click(Sender: TObject);
var
  Index : integer;
begin
  Index := dOPCServerBrowser1.FindByClassID('{D64E68EE-BB58-47A5-A565-57F36C0B4A20}');
  if Index >= 0 then //if exists
  begin
    ShowMessage(dOPCServerBrowser1.Items[index].ServerCaption);
  end
  else
    ShowMessage('not found');
end;
What do you think about this topic? Send feedback!
Copyright © 2001-2014 Kassl GmbH (http://www.kassl.de). All rights reserved.