diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index a6161056..c49841c5 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -433,8 +433,16 @@ namespace nana { check_range(pos, cont_.size()); + //The order of cont_'s elements is the display order. if (!disp_order) - pos = this->cast(pos, false); + { + /// It always match the item with pos, otherwise a bug occurs. + for (auto & m : cont_) + { + if (m.index == pos) + return m; + } + } return cont_[pos]; }