先将这几个树列表回调注释给解开
int TreeColumn=0;//定义一个全局边量记录点击的那一列NXOpen::BlockStyler::Tree::BeginLabelEditState OnBeginLabelEditCallback(NXOpen::BlockStyler::Tree *tree,NXOpen::BlockStyler::Node *node,int columID)
{if(columnID==TreeColumnID){return NXOpen::BlockStyler::Tree::BeginLabelEditStateAllow;}else{return NXOpen::BlockStyler::Tree::BeginLabelEditStateDisallow;}}NXOpen::BlockStyler::Tree::EndLabelEditState OnEndLabelEditCallback(NXOpen::BlockStyler::Tree *tree,NXOpen::BlockStyler::Node *node,int columID)
{return NXOpen::BlockStyler::Tree::EndLabelEditStateAcceptText;
}NXOpen::BlockStyler::Tree::ControlType AskEditControlCallback(NXOpen::BlockStyler::Tree *tree,NXOpen::BlockStyler::Node *node,int columID)
{NXOpen::BlockStyler::Tree::ControlType AskEditControl=NXOpen::BlockStyler::Tree::ControlTypeNone;TreeColumn=columnID;return AskEditControl;
} void OnDefaultAction(NXOpen::BlockStyler::Tree *tree,NXOpen::BlockStyler::Node *node,int columID)
{keybd_event(113,0,0,0);//F2按下keybd_event(113,0,KEYEVENTF_KEYUP,0);//F2抬起
}
相当于模拟按键盘F2强制快速进入编辑状态