Combo Box List Width

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
Johann

Combo Box List Width

Post by Johann » 05 Apr 2006, 09:53

 Posted by:  Johann 

Hi

I am looking for a sample to adjust the width of the dropdown-list of a
combo box.

I have tried the following which I found in a post earlier by Rainer Ebert
on 25 May 2005 but I am not able to get it running correctly and I don't
know why:

SalSendMsg(hWndCmb, CB_SETDROPPEDWIDTH, nMaxWidth, 0)
Number: CB_SETDROPPEDWIDTH = 0x0160

A sample will hopefully tell me where my problem is.

Thanks
Johann

BSB

Re: Combo Box List Width

Post by BSB » 05 Apr 2006, 11:31

 Posted by:  BSB 

Johann,

Attached is the sample you are looking for. I got this from one of the
newsgroup members. So all the credit to him.-)

Thanks,
Seshu.

You do not have the required permissions to view the files attached to this post.

Johann

Re: Combo Box List Width

Post by Johann » 05 Apr 2006, 13:21

 Posted by:  Johann 

Hi Seshu

Thanks for the example it is what I was looking for.

There is no way of implementing this without creating a new Combo box class,
right?

Thanks,
Johann

Johann

Re: Combo Box List Width

Post by Johann » 05 Apr 2006, 14:48

 Posted by:  Johann 

Should have added this.

I would like to change the size at runtime >
Scenario:
3 x Radio buttons, 1 x Combo Box
If a different radio button is selected the combo box is repopulated.
This means that it might be required to resize the dropdown-list.

It seems as though it is not possible if a new class is created to implement
this.

Johann

BSB

Re: Combo Box List Width

Post by BSB » 06 Apr 2006, 07:00

 Posted by:  BSB 

Johann,

No need to create new combobox class. My requirement was also the same as
yours and I have customized the implementation. See the Internal function in
the attached app(TD3.1). After you populate the combobox call the function
fnSetDroppedWidth( 0, ). Hope this helps you.

Seshu.

You do not have the required permissions to view the files attached to this post.

Johann

Re: Combo Box List Width

Post by Johann » 06 Apr 2006, 08:02

 Posted by:  Johann 

Seshu,

Thanks, this is it!!
I have at last also found my problem in implementing this > the value I
passed with SalSendMsg for the width was too small and that is the reason
why the width was never adjusted.

Thanks alot for your help!!

Johann

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 0 guests