Форум: "Основная";
Текущий архив: 2003.08.28;
Скачать: [xml.tar.bz2];
ВнизTVS_CHECKBOXES. Как определить что ветвь с галочкой? Найти похожие ветки
← →
Song (2003-08-15 11:48) [0]Пробовал по TreeView_GetItem. Но он похоже не возвращает такой информации. У него есть
typedef struct _TV_ITEM { tvi
UINT mask;
HTREEITEM hItem;
UINT state;
UINT stateMask;
LPSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int cChildren;
LPARAM lParam;
} TV_ITEM, FAR *LPTV_ITEM; ]
но TVIS_SELECTED даёт нам не то что нужно:
TVIS_SELECTED The item is selected. The appearance of a selected item depends on whether it has the focus and on whether the system colors are used for selection.
Кто-нибудь сталкивался?
← →
MBo (2003-08-15 11:54) [1]маску надо заполнять
function TVGetCheck(TV:TTreeView; n:integer):integer;
var
item:tTVItem;
begin
item.hItem:=TV.Items[n].ItemId;
item.mask:= TVIF_STATE;
TV.Perform(TVM_GETITEM,0,integer(@item));
Result:=(item.state and $2000) shr 13;
end;
← →
Song (2003-08-15 13:30) [2]Спасибо, MBo, знал что ты поможешь ;)
А чего она возвращает? Что за число?
← →
Song (2003-08-15 13:33) [3]У меня для любых веток возвращает единицу:
With TStringList.Create Do
try
With TreeView1 Do For t:=0 to Items.Count-1 Do
IF Items[t].Level=0 then Add(IntToStr(TVGetCheck(TreeView1,0))) else Add("");
finally
Free;
end;
← →
Song (2003-08-15 13:36) [4]Всё разобрался, походу дела я перегрелся :)
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2003.08.28;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.007 c