Brian,

I do something similar in my application. Have you looked at the -dropdown
and -dropdownlist options? The different behaviours are explained at 

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pla
tform/commctls/comboboxes/comboboxes.asp

I use -dropdown with a GotFocus routine to force open the list something
like this:

=================================================

use Win32::GUI;

use constant CURSOR_ARROW => 65553;

$mw = new Win32::GUI::Window(
    -name       => "mw",
    -size       => [200, 200],
);

$mw->AddCombobox(
        -name     => "cbCombo",
        -size     => [170, 110],
        -pos      => [10, 10],
        -vscroll  => 1,
        -dropdown => 1,
);

$mw->cbCombo->SetExtendedUI(1);         # Down arrow to drop down list

$mw->cbCombo->AddString($_) for qw(Alan Bernard Cindy Diane Eric Francis
Graham);

sub cbCombo_GotFocus {
        $mw->cbCombo->ShowDropDown(1);
        Win32::GUI::SetCursor(CURSOR_ARROW);
}

$mw->Show();
Win32::GUI::Dialog();

=====================================================================

Glenn

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brian
Millham
Sent: Sunday, 19 September, 2004 21:17
To: perl-win32-gui-users
Subject: [perl-win32-gui-users] Combobox and KeyPress

Is there a way to detect the KeyPress event for a Combobox?  Or am I going
about what I want to do wrong.

I have a Combobox that is populated from a database.  What I'm trying to do
is to be able to just select the item like normal with a mouse click, or to
be able to type in the first few letters and have the matching item
selected.  I'd also like to be able to enter a non-matching entry that would
then be added to the database.

Is this possible with a Combobox?

Brian Millham
[EMAIL PROTECTED] 

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0438-3, 09/17/2004
Tested on: 9/19/2004 8:17:22 PM
avast! is copyright (c) 2000-2003 ALWIL Software.
http://www.avast.com






-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users




Reply via email to