On 12/07/07, pcourterelle <[EMAIL PROTECTED]> wrote:
Yes I understood the meaning of the description fine and I'm not questioning
whether the code works.  It just never worked in my implementation. I took
the meaning of the description to mean that when the TopIndex is set to (0)
the item at (0) will be visible in the Listbox window. Yes the scrollbar is
visible and active and the drop down works with scrollbar.

It's must more obvious with an old-style listbox (code below).  In the
case of a drop-down list box it appears that clicking the
drop-down-arrow resets the list to the top if there's no selection in
the combo/edit box.

If you open drop-down-list before calling SetTopIndex(), then you can
also see it happening orrectly (again, code below).

Hope this helps.

Regards,
Rob.

#! perl -w
use strict;
use warnings;

use Win32::GUI 1.05 qw(CW_USEDEFAULT);

my $mw = Win32::GUI::Window->new(
   -left => CW_USEDEFAULT,
   -size => [400,300],
);

my $cb = $mw->AddCombobox(
-pos  => [10,10],
-size => [200,100],
-vscroll => 1,
);

$cb->Add($_) for (0 .. 99);

$cb->SetTopIndex(50);

$mw->Show();
Win32::GUI::Dialog();
$mw->Hide();
exit(0);
__END__

#! perl -w
use strict;
use warnings;

use Win32::GUI 1.05 qw(CW_USEDEFAULT);

my $mw = Win32::GUI::Window->new(
   -left => CW_USEDEFAULT,
   -size => [400,300],
);


my $cb = $mw->AddCombobox(
-pos  => [10,10],
-size => [200,100],
-vscroll => 1,
-dropdownlist => 1,
);

$cb->Add($_) for (0 .. 99);

$cb->ShowDropDown(1);
$cb->SetTopIndex(50);

$mw->Show();
Win32::GUI::Dialog();
$mw->Hide();
exit(0);
__END__

Reply via email to