treeview pfc控件的用法

integer li_rep,li_rec
this.of_SetBase(true)
this.of_setfind(true)
this.of_SetLevelSource(TRUE)
ib_rmbmenu=false
tv_1.inv_levelsource.of_Register(1, "classname","","d_materialroot", SQLCA, "")
tv_1.inv_levelsource.of_SetPictureColumn(1, "1")
tv_1.inv_levelsource.of_SetSelectedPictureColumn(1, "1")

tv_1.inv_levelsource.of_Register(2,"typename","parent.1.classname","d_mtrl_class_cyg",SQLCA,"")

//if li<> 1 then MessageBox('',string(li))
tv_1.inv_levelsource.of_SetPictureColumn(2, "1")
tv_1.inv_levelsource.of_SetSelectedPictureColumn(2, "2")
integer li_maxlevel
select max(ranknumber) into :li_maxlevel from classification;
for li_rec=3 to li_maxlevel + 1
 if this.inv_levelsource.of_Register(li_rec, "typename", &
          ":level.1.classname,parent.1.typename", "d_mtrl_class_2_cyg", SQLCA, "")<>1 then MessageBox('tvs出错',string(li_rec))
 this.inv_levelsource.of_SetPictureColumn(li_rec, "1")
 this.inv_levelsource.of_SetSelectedPictureColumn(li_rec, "2")
next

tv_1.event pfc_populate(0)

你可能感兴趣的:(treeview)