Home > database >  Novice: ask a tree control problem
Novice: ask a tree control problem

Time:09-18

If choose this tag normal display

Normal display

If press the "+" label will more than one project

According to many project

The data window



Ask each ace to give directions

This is the code itempopulates events

Long ll_handle lev3, lev4//define a variable, save node handle.
lString MC, dd, dw_name dw_djmc, dw_djbw2, dw_djxm, md,
Int I

Treeviewitem ltvi_data//define a variable, save the content such as node

Ll_handle=tv_1. Finditem (currenttreeitem! , 0)//get the handle to the currently selected node
Tv_1. The getitem (ll_handle ltvi_data)

MC=ltvi_data. Label
Md=f_getxingqi (today ())//get the week

Dw_3. Setfilter (" xingming='" + MC + "' "+" AND riqi='" + md + "' ")//filter name AND what day
//dw_3. Setfilter (" xingming='" + MC + "' ")//filter name and what day

Dw_3. Filter ()
Dw_3. Setsort (" id "a)//data sorting, prevent projects disorderly
Dw_3. Sort ()
Dw_name=dw_3. Getitemstring (1, 2)




If the MC=dw_name then//this is added in the third layer
For I=1 to dw_3. Rowcount ()

Dw_djmc=dw_3. Getitemstring (I, 5)
Dw_djbw2=dw_3. Getitemstring (I, 6)
If isnull (dw_djmc) then//if the device name is empty

If isnull (dw_djbw2) then//is empty if equipment parts
Tv_1. Insertitemlast (lev4, dw_3 getitemstring (I, 7), 3)//added to the fifth layer
The else
Lev4=tv_1. Insertitemlast (lev3, dw_3 getitemstring (I, 6), 3)
Tv_1. Insertitemlast (lev4, dw_3 getitemstring (I, 7), 3)
End the if
The else
Lev3=tv_1. Insertitemlast (ll_handle, dw_3 getitemstring (I, 5), 3)
Lev4=tv_1. Insertitemlast (lev3, dw_3 getitemstring (I, 6), 3)
Tv_1. Insertitemlast (lev4, dw_3 getitemstring (I, 7), 3)

End the if

End for

end if

CodePudding user response:

You couldn't see from the code error, you need to single-step tracking, affirmation is to create duplicate

CodePudding user response:

Why points "+" is new, the text is not new

CodePudding user response:

The question is very difficult to? How no one explanation

CodePudding user response:

In fact, I didn't understand what you want to express meaning, what's wrong

CodePudding user response:

Just point "hydraulic system", can display the "pump" and "line" normal two tags
If the point "of the hydraulic system" in front of the "+", will be out of the two identical stand circulatory system ", "hydraulic system rather than his subordinates

CodePudding user response:

reference 5 floor ai233622600 reply:
is the point of "hydraulic system", can display the "pump" and "line" normal two tags
If the point "of the hydraulic system" in front of the "+", will be out of the two identical stand circulatory system ", "hydraulic system rather than his subordinates tag


Ll_handle=tv_1. Finditem (currenttreeitem! , 0)
The problem here, click on the "hydraulic system", "hydraulic system" text the treeviewitem is set selected object,
Point in front of the "+", "hydraulic system", this time the selected treeviewitem is word for this object, Jin Bingku
So just insert again once,
You can break into the if MC=dw_name then//this is added to look at both the value of the third floor

CodePudding user response:

Thank you very much! I in check
  • Related