I'm not sure this is the best way, but what I would do is change 

$bftextdecdd->FirstVisibleItem();
to
$bftextdecdd->Select(0);

That will automatically select the first element in your list.
( it is 0 because combobox uses a 0-based index to reference the items
in the list ).


Hope that helps.

Dave McLaughlin
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Chris Etzel
Sent: Sunday, June 03, 2001 1:56 AM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] showing firstvisible in a combo box


Hey,

I have this code, and I want to make the word 'none' from the list
visible by default and then the user can choose something else if they
want. I have looked through the docs and have tried FirstVisibleItem but
no luck. Any help appreciated!

Chris

$bftextdecdd=$Win1->AddCombobox(
 -name=>"bftextdecdd",
 -width=>100,
 -height=>100,
 -tabstop=>1,
 -top=>242,
 -left=>370,
 -style=> WS_VISIBLE | WS_SCROLL | 3
 );

      $bftextdecdd->InsertItem("none");
    $bftextdecdd->InsertItem("blink");
    $bftextdecdd->InsertItem("line-through");
    $bftextdecdd->InsertItem("underline");
    $bftextdecdd->InsertItem("overline");
    #$bftextdecdd->FirstVisibleItem(); how the hell do I show 'none' as
    #first visible by default?

    sub bftextdecdd_Change{

$bftextdecdd->Text($bftextdecdd->GetString($bftextdecdd->SelectedItem));
     }



_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users


Reply via email to