 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Markus Klein Guest
|
Posted: Thu Sep 11, 2003 3:32 pm Post subject: TComboBox::DropDown |
|
|
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
|
Posted: Thu Sep 11, 2003 4:39 pm Post subject: Re: TComboBox::DropDown |
|
|
"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
|
Posted: Fri Sep 12, 2003 8:37 am Post subject: Re: TComboBox::DropDown |
|
|
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
|
Posted: Fri Sep 12, 2003 5:26 pm Post subject: Re: TComboBox::DropDown |
|
|
"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
|
Posted: Tue Sep 30, 2003 9:25 am Post subject: Re: TComboBox::DropDown |
|
|
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
|
Posted: Fri Oct 03, 2003 10:49 pm Post subject: Re: TComboBox::DropDown |
|
|
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
|
Posted: Sat Oct 04, 2003 12:46 am Post subject: Re: TComboBox::DropDown |
|
|
"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 |
|
 |
|
|
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
|
|