如何在D365FO中的树控件上显示图标

时间:2019-12-12 10:40:50

标签: axapta microsoft-dynamics x++ dynamics-365-operations

请如何在Dynamics 365 for Finance and Operations中的FormTreeControl上显示图标

Icons in Tree Control in Dynamics AX 2012

这是我的实际代码,用于在D365FO #ResAppl宏中显示图标

公共类IconsTree扩展FormRun {

public void init()
{
    SalesTable _Table;
    TreeItemIdx _TreeItemid;

    super();

    MyTreeView.deleteAll(); //This is my Tree Control on Form
    MyTreeView.lock();

    ImageListAppl dd = new ImageListAppl();
    ImageRes imageRes = dd.image(#ImageFormButtonGroup);

    MyTreeView.setImagelist(dd.imageList());



    while select * from _Table
    {

        _TreeItemid = SysFormTreeControl::addTreeItem(MyTreeView, "Sales Order :" + _Table.SalesId ,FormTreeAdd::Root,  _Table.RecId, #ImageOverlayYellowLock);
        SysFormTreeControl::addTreeItem(MyTreeView, " Customer Account : " + _Table.CustAccount ,_TreeItemid ,  _Table.RecId);
        SysFormTreeControl::expandTree(MyTreeView,_TreeItemid);
        SysFormTreeControl::setOverlayImage(MyTreeView, _TreeItemid, imageRes);
    }
}

}

和结果,没有图标:

enter image description here

1 个答案:

答案 0 :(得分:2)

根据我的理解以及Microsoft的指示,不允许在 D365FO 中的树控件上使用图像或图标。

允许使用什么build extensible controls,请检查此链接Check box support in tree controls