PC Review


Reply
Thread Tools Rate Thread

Disabling ComboBox's DropDown Popup

 
 
Brian Takita
Guest
Posts: n/a
 
      12th Aug 2003
Hello,

Is it possible to disable the ComboBox DropDown ListBox control from the
OnDropDown override method?

I'm trying to use a ListView to popup, instead of a ListBox.

So far, I've been able to "disable" the dropdown by changing the focus
to the Listview

protected override void OnDropDown(System.EventArgs e) {
_popup.Show();
_popup.Focus();
base.OnDropDown(e);
}

However, the dropdown ListBox briefly flashes in front of the ListView.

Please let me know if you have a better solution. If there is a way to
set the dropdown box to a ListView control, that would be even better.

Thank you,
Brian Takita

 
Reply With Quote
 
 
 
 
Claes Bergefall
Guest
Posts: n/a
 
      12th Aug 2003
Are you creating the ListView in response to the DropDown event?
Is so, try creating it with the dropdown listbox as a parent.
You can get the HWND of it by using GetComboBoxInfo

Then override ListView.CreateParams and sepecify that
HWND as a parent

/claes


"Brian Takita" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> Is it possible to disable the ComboBox DropDown ListBox control from the
> OnDropDown override method?
>
> I'm trying to use a ListView to popup, instead of a ListBox.
>
> So far, I've been able to "disable" the dropdown by changing the focus
> to the Listview
>
> protected override void OnDropDown(System.EventArgs e) {
> _popup.Show();
> _popup.Focus();
> base.OnDropDown(e);
> }
>
> However, the dropdown ListBox briefly flashes in front of the ListView.
>
> Please let me know if you have a better solution. If there is a way to
> set the dropdown box to a ListView control, that would be even better.
>
> Thank you,
> Brian Takita
>



 
Reply With Quote
 
Brian Takita
Guest
Posts: n/a
 
      12th Aug 2003
I can get the HWND by using the
Handle property.

How do you get access to the dropdown ListBox in the ComboBox?

Claes Bergefall wrote:
> Are you creating the ListView in response to the DropDown event?
> Is so, try creating it with the dropdown listbox as a parent.
> You can get the HWND of it by using GetComboBoxInfo
>
> Then override ListView.CreateParams and sepecify that
> HWND as a parent
>
> /claes
>
>
> "Brian Takita" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>>Hello,
>>
>>Is it possible to disable the ComboBox DropDown ListBox control from the
>>OnDropDown override method?
>>
>>I'm trying to use a ListView to popup, instead of a ListBox.
>>
>>So far, I've been able to "disable" the dropdown by changing the focus
>>to the Listview
>>
>>protected override void OnDropDown(System.EventArgs e) {
>>_popup.Show();
>>_popup.Focus();
>>base.OnDropDown(e);
>>}
>>
>>However, the dropdown ListBox briefly flashes in front of the ListView.
>>
>>Please let me know if you have a better solution. If there is a way to
>>set the dropdown box to a ListView control, that would be even better.
>>
>>Thank you,
>>Brian Takita
>>

>
>
>


 
Reply With Quote
 
Claes Bergefall
Guest
Posts: n/a
 
      13th Aug 2003
"Brian Takita" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I can get the HWND by using the
> Handle property.


No. That will give you the HWND of the combobox itself
Read this to understand the parts of a combobox:
http://support.microsoft.com/?kbid=65881

>
> How do you get access to the dropdown ListBox in the ComboBox?
>


As I told you; GetComboBoxInfo will give you its HWND.
You'll have to use P/Invoke since it's a Win32 function

> Claes Bergefall wrote:
> > Are you creating the ListView in response to the DropDown event?
> > Is so, try creating it with the dropdown listbox as a parent.
> > You can get the HWND of it by using GetComboBoxInfo
> >
> > Then override ListView.CreateParams and sepecify that
> > HWND as a parent
> >
> > /claes
> >
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
databind dropdown from popup biju Microsoft ASP .NET 1 5th Sep 2007 10:31 PM
Disabling Dropdown Menu Items Mammagoose11 Microsoft Outlook Contacts 2 24th Oct 2004 08:54 PM
Re: Bug: Combobox.dropdown = True during Form.Load event handler causes listbox to be disabled, even though combobox is Enabled. Herfried K. Wagner [MVP] Microsoft Dot NET Framework Forms 0 12th Feb 2004 10:00 PM
Bug: Combobox.dropdown = True during Form.New() causes listbox to be disabled, even though combobox is Enabled. =?Utf-8?B?UmF0a2lsZXk=?= Microsoft Dot NET Framework Forms 1 12th Feb 2004 09:58 PM
Bug: Combobox.dropdown = True during Form.Load event handler causes listbox to be disabled, even though combobox is Enabled. =?Utf-8?B?UmF0a2lsZXk=?= Microsoft Dot NET Framework 0 12th Feb 2004 07:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:09 AM.