Description
Widget key parameters are used to differentiate all instances of the same widget. The parameters are a pair of key-value strings.
Example
| C# | Copy Code |
|---|
try { SAPbouiCOM.Cockpits ckpts = (SAPbouiCOM.Cockpits)sbo_Application.Cockpits; SAPbouiCOM.Cockpit ckptCurrent = (SAPbouiCOM.Cockpit)ckpts.CurrentCockpit; //Traverse all the widget instances in this cockpit. for(int i=0; i<ckptCurrent.Widgets.Count; ++i) { SAPbouiCOM.Widget wdt = (SAPbouiCOM.Widget)ckptCurrent.Widgets.Item(i); //ZERO based. //Traverse all the keys. SAPbouiCOM.WidgetKeysParams wdtKeys = (SAPbouiCOM.WidgetKeysParams)wdt.GetKeyList(); for(int j=0; j<wdtKeys.Count; ++j) { //Get the key-value: string pairs. SAPbouiCOM.WidgetKeyParams wdtKeyValuePair = (SAPbouiCOM.WidgetKeyParams)wdtKeys.Item(j); //Check the key-value. if(true == wdtKeyValuePair.Key.Equals("key") || true == wdtKeyValuePair.Value.Equals("value")) { //It is the value that was set last time, so desired widget instance found. Do something necessary now... } } } } catch(Exception ex) { MessageBox.Show("Excpetion in Cockpit Operations\n" + ex.Message);
|
|
See Also