2017-07-05 13 views
-1

のSAPシステムでは、SAP GuiTreeを頻繁に使用しています。左の列には、説明が含まれています。 2番目の列には、あらゆる点に情報を含むホーイングがあります。このコードではSAP GuiTree Elementの2番目の列にアクセスする方法は?

enter image description here

、私は、各ノードのテキストを読むことができます:

 /*ID is the SAPFEWSELib.GuiComponent.Id of the SAPFEWSELib.GuiTree; SAPWindow is the mainwindow 
     of SAP of type SAPFEWSELib.GuiMainWindow*/ 
     SAPFEWSELib.GuiTree GT = (SAPFEWSELib.GuiTree)SAPWindow.FindById(ID); 
     foreach (string key in GT.GetAllNodeKeys()) 
     { 
      System.Console.WriteLine("Key " + key + " contains " + GT.GetNodeTextByKey(key)); 
     } 

はに二列にアクセスする可能性はありますか?

+0

「ホーイング」とは何ですか?私は都市の辞典によって提供される説明に心地よいと確信していません... – vwegert

+0

それは私の問題の解決に私をずっと近づけてくれてありがとうございます... – Jan021981

+0

私はそのような都市の話を崇拝し、そのような都市の助け:) – Suncatcher

答えて

0

わかりました。項目がチェックされている場合、ホーイングにはツールチップがあります。

System.Collection.Generic.List<System.Collection.Generic.KeyValuePair<string, bool>> MyList = new System.Collection.Generic.List<System.Collection.Generic.KeyValuePair<string, bool>>(); 
string NodeText = string.Empty; 
bool = TextExist = false; 
SAPFEWSELib.GuiTree GT = (SAPFEWSELib.GuiTree)SAPWindow.FindById(ID); 
foreach(string key in GT.GetAllNodeKeys()){ 
    NodeText = GT.GetItemText(key, "1"); //1 is the column index, starts with 1 
    if(GT.GetItemText(key, "2").Length > 0){TextExist = true;}else{TextExist = false;} 
    MyList.Add(new System.Collection.Generic.KeyValuePair(NodeText, TextExist); 
} 

希望すると、これは他の開発者の役に立ちます。

関連する問題