Problem is that height of CComboBox rectangle which is created in resource
editor is more than my CListCtrl item height.
How to decrease height of CComboBox ?
(Not height of items in ComboBox drop down list but height of CComboBox
which is not active)
Peter
If you are just trying to resize the control in the resource editor you can
click on the outside box of the control to resize horizontally, or click on
the down arrow to resize the drop down list size.
This article is a little dated so the sample code may not compile without
some conversion, but the steps listed here are good and I think this may be
what you're trying to do. In any event, it should help you get started.
http://www.codeguru.com/cpp/controls/listview/editingitemsandsubitem/article.php/c979
Tom
"Peter" <Pe...@discussions.microsoft.com> wrote in message
news:A462822E-160A-419D...@microsoft.com...
You should be able to change it by calling SetWindowPos on the
combobox.
-
Ajay
> I have CListCtrl placed on dialog.
> For editing subitems I have used CComboBox of type dropdown and this
> CComboBox is placed on edited cell in time of editing…
Use the combobox’s SetItemHeight function, passing -1 as the index:
m_ComboBox.SetItemHeight(-1, 23); //will make the control taller than usual
m_ComboBox.SetItemHeight(-1, 7); //will make the control shorter than usual
Just set the height to whatever the height of the items in your list control is.
HTH
--
Alec S.
news/alec->synetech/cjb/net
> …
On Wed, 20 Aug 2008 22:43:56 -0400, "Alec S." <@> wrote:
>Peter wrote (in news:A462822E-160A-419D...@microsoft.com):
>
>> I have CListCtrl placed on dialog.
>> For editing subitems I have used CComboBox of type dropdown and this
>> CComboBox is placed on edited cell in time of editing…
>
>
>Use the combobox’s SetItemHeight function, passing -1 as the index:
>
>m_ComboBox.SetItemHeight(-1, 23); //will make the control taller than usual
>m_ComboBox.SetItemHeight(-1, 7); //will make the control shorter than usual
>
>Just set the height to whatever the height of the items in your list control is.
>
>
>HTH
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
> I presume that the "correct height" is obtained by GetWindowRect on the edit
> control, and will not be a hardwired integer.
Oh haha! :P Only in pseudo code as a placeholder. I don’t like splaying open all
the viscera of my code when asking for help; I distill it down to the
essentials.
--
Alec S.
news/alec->synetech/cjb/net
> On Wed, 20 Aug 2008 22:43:56 -0400, "Alec S." <@> wrote:
that there was an error in my example because the "..." wouldn't compile. Never
underestimate the lack of imagination of your readers...
joe
On Thu, 21 Aug 2008 12:31:19 -0400, "Alec S." <@> wrote:
>Joseph M. Newcomer wrote (in news:612qa4d9ju6ad6plf...@4ax.com):
>
>> I presume that the "correct height" is obtained by GetWindowRect on the edit
>> control, and will not be a hardwired integer.
>
>Oh haha! :P Only in pseudo code as a placeholder. I don’t like splaying open all
>the viscera of my code when asking for help; I distill it down to the
>essentials.
> I actually had a student complain about one of my examples
> if(!finder.IsDirectory())
> ... file stuff here
> else
> ... directory stuff here
> that there was an error in my example because the "..." wouldn't compile.
> Never underestimate the lack of imagination of your readers...
Fair enough. However I believe that my example was clear enough to remove
confusion for all but the most dense—whom I would imagine would have difficulty
programming anyway.
--
Alec S.
news/alec->synetech/cjb/net
> On Thu, 21 Aug 2008 12:31:19 -0400, "Alec S." <@> wrote:
>
> > Joseph M. Newcomer wrote (in
> > news:612qa4d9ju6ad6plf...@4ax.com):
> >
> > > I presume that the "correct height" is obtained by GetWindowRect on the
> > > edit control, and will not be a hardwired integer.
> >
> > Oh haha! :P Only in pseudo code as a placeholder. I don’t like splaying
> > open all the viscera of my code when asking for help; I distill it down to
> > the essentials.
>