BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TComboBox::DropDown

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development)
View previous topic :: View next topic  
Author Message
Markus Klein
Guest





PostPosted: Thu Sep 11, 2003 3:32 pm    Post subject: TComboBox::DropDown Reply with quote



Hello,

I derived a component from TComboBox and overwrote the method
DropDown. Now I would like to prevent in this function drop
down the ComboBox, or not. Is this the correct place for it?
Knows someone how I can realize that?

Thanks


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Sep 11, 2003 4:39 pm    Post subject: Re: TComboBox::DropDown Reply with quote




"Markus Klein" <markusklein (AT) justmail (DOT) de> wrote


Quote:
I derived a component from TComboBox and overwrote
the method DropDown. Now I would like to prevent in
this function drop down the ComboBox, or not. Is this
the correct place for it?

Post WM_CANCELMODE and CB_SHOWDROPDOWN messages to the ComboBox to cancel
the drop-down of the list.


Gambit





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03




Back to top
Markus Klein
Guest





PostPosted: Fri Sep 12, 2003 8:37 am    Post subject: Re: TComboBox::DropDown Reply with quote



Thanks Gambit,

it works, but the ComboBox drops down and then close.
How can I realize, that the ComboBox do not drop down?

Thanks


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Sep 12, 2003 5:26 pm    Post subject: Re: TComboBox::DropDown Reply with quote


"Markus Klein" <markusklein (AT) justmail (DOT) de> wrote


Quote:
it works, but the ComboBox drops down and then close.

Are you using SendMessage() or PostMessage()? If the latter then try using
the former instead, or alternatively Perform().


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03




Back to top
Markus Klein
Guest





PostPosted: Tue Sep 30, 2003 9:25 am    Post subject: Re: TComboBox::DropDown Reply with quote

Hi,

I try CBO->Perform( CBN_CLOSEUP, 0, 0 ).
This has the same effect, how post the messages
WM_CANCELMODE and CB_SHOWDROPDOWN to the ComboBox.
Any Idea?

Thanks


Back to top
Salvador Huertas
Guest





PostPosted: Fri Oct 03, 2003 10:49 pm    Post subject: Re: TComboBox::DropDown Reply with quote

I had the same problem and solved it, overloading the WndProc function.

Here you had the code I used (Get by experimentation with the debugger):

void __fastcall TTreuComboBox::WndProc(Messages::TMessage &Message) {

if (Message.Msg==CN_COMMAND) {
if ((HWND)Message.LParam==Handle && (int)Message.WParamHi==CBN_DROPDOWN)
{
DropDown();
Message.Result=0;
pulsado=true;
return;
}
}
if (pulsado==true && Message.Msg==308) {
pulsado=false;
DroppedDown=false;
SendMessage(this->WindowHandle,513,0,0);
return;
}
TCustomComboBox::WndProc(Message);
}

Regards.
Salvador Huertas.
[email]shuertasw (AT) terra (DOT) es[/email]



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sat Oct 04, 2003 12:46 am    Post subject: Re: TComboBox::DropDown Reply with quote


"Salvador Huertas" <none@none> wrote


Quote:
if (pulsado==true && Message.Msg==308) {
snip
SendMessage(this->WindowHandle,513,0,0);

FYI, those messages are WM_CTLCOLORLISTBOX and WM_MOUSEMOVE, respectively:

if (pulsado==true && Message.Msg==WM_CTLCOLORLISTBOX)
...
SendMessage(Handle, WM_MOUSEMOVE, 0, 0);


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.