|
工業(yè)單據(jù)敘事簿 添加菜單和現(xiàn)實(shí)在工具欄上VB插件/*
t_bandtoolmapping解釋: FID,FBandID,FToolID,FSubBandID,FIndex,FComName,FBeginGroup FID 是放到那種類型下面 FID=82 表示外購(gòu)入庫(kù) FID是這里的FmenuID :select FID,FmenuID,* from iclisttemplate where Fname LIKE '%外購(gòu)入庫(kù)%' FBandID 是菜單的位置,1表示放到1級(jí)欄目下,2表示放在文件下面,3表示放在編輯下面,4表示放在查看下面,5表示放在格式下面,53表示放在工具欄上 */ --增加一個(gè)按鈕菜單, insert into t_MenuToolBar ( FToolID,FName,FCaption,FCaption_CHT,FCaption_EN,FImageName,FToolTip,FToolTip_CHT,FToolTip_EN,FControlType,FVisible,FEnable,FChecked,FShortCut,FCBList,FCBList_CHT,FCBList_EN,FCBStyle,FCBWidth,FIndex,FToolCaption,FToolCaption_CHT,FToolCaption_EN) values (10002,'FMenuPC1','序事簿菜單','序事簿菜單','序事簿菜單','39','序事簿菜單','序事簿菜單','序事簿菜單',0,0,1,0,0,'','','',0,0,0,'序事簿菜單','序事簿菜單','序事簿菜單') --執(zhí)行下面的代碼才能在菜單上看到我們需要的效果,要不然,菜單是隱藏狀態(tài)的(如果里面有"|V",則只能在后面加菜單項(xiàng)),可支持多個(gè)自定義菜單 Update IclistTemplate set FLogicStr=FLogicStr+ Case When Right(FLogicStr,1)='|' then 'V:FMenuPC1' else '|V:FMenuPC1' end where FID =1 and not FLogicStr like '%FMenuPC1%' --加到菜單頭上,可以不用的 insert into t_BandToolMapping(FID,FBandID,FToolID,FSubBandID,FIndex,FComName,FBeginGroup) values(82,1,10002,6,6,'|ICMOListBill.ListBill',0) --加到文件菜單下面 insert into t_BandToolMapping(FID,FBandID,FToolID,FSubBandID,FIndex,FComName,FBeginGroup) values(82,2,10002,0,17,'|ICMOListBill.ListBill',0) --加到編輯菜單下面 insert into t_BandToolMapping(FID,FBandID,FToolID,FSubBandID,FIndex,FComName,FBeginGroup) values(82,3,10002,0,18,'|ICMOListBill.ListBill',0) --加到查看菜單下面 insert into t_BandToolMapping(FID,FBandID,FToolID,FSubBandID,FIndex,FComName,FBeginGroup) values(82,4,10002,0,70,'|ICMOListBill.ListBill',0) --加到格式下面 insert into t_BandToolMapping(FID,FBandID,FToolID,FSubBandID,FIndex,FComName,FBeginGroup) values(82,5,10002,0,74,'|ICMOListBill.ListBill',0) --加到工具欄上 insert into t_BandToolMapping(FID,FBandID,FToolID,FSubBandID,FIndex,FComName,FBeginGroup) values(82,53,10002,0,189,'|ICMOListBill.ListBill',0) --好像沒(méi)什么實(shí)際意思 insert into t_BandToolMapping(FID,FBandID,FToolID,FSubBandID,FIndex,FComName,FBeginGroup) values(82,56,10002,0,5,'|ICMOListBill.ListBill',0) 在ICMOListBill.ListBill里面主要實(shí)現(xiàn)一個(gè)MainFunction 方法 實(shí)例代碼: Public Sub MainFunction(ByVal sKey As String, oList As Object, ByRef bCancel As Boolean) Dim vectors As KFO.Vector If sKey = "FMenuPC1" Then Set vectors = oList.getselected MsgBox vectors.Item(1).finterid MsgBox oList.ListSelectBillinfo(1)("FInterID") end if End Sub 只要在VB里面編輯成DLL,然后用我上面的代碼注冊(cè)下插件,然后我們進(jìn)K3,就會(huì)在我們的工具欄上和菜單欄 |
|
|