I am using a combo box . It functions except it does not come up with the
top value of the list to be inside the visible rectangle area, that area is
blank. Can someone tell me how to have the top value appear in the combo
box?

Re: combo box default value by William

William
Thu Sep 30 00:15:02 CDT 2004

"Frank" <f_rubino@prodigy.net> wrote in message
news:54M6d.11865$Qv5.6672@newssvr33.news.prodigy.com...
>I am using a combo box . It functions except it does not come up with the
> top value of the list to be inside the visible rectangle area, that area
> is
> blank. Can someone tell me how to have the top value appear in the combo
> box?

I'm not sure I understand your question, but if you want to know how to
select an element of a combo box then check the docs for the CB_SETCURSEL
message. If you need more information you should post follow-up in

microsoft.public.win32.programmer.ui

Regards,
Will



Re: combo box default value by GuitarBill

GuitarBill
Thu Sep 30 01:35:40 CDT 2004

Is this is an MFC dialog control? If so you can map it to an integer and set
the default/initial value in the dialog's constructor (default is -1,
meaning nothing selected).


"Frank" <f_rubino@prodigy.net> wrote in message
news:54M6d.11865$Qv5.6672@newssvr33.news.prodigy.com...
> I am using a combo box . It functions except it does not come up with the
> top value of the list to be inside the visible rectangle area, that area
is
> blank. Can someone tell me how to have the top value appear in the combo
> box?
>
>
>



Re: combo box default value by Drew

Drew
Thu Sep 30 11:48:56 CDT 2004

If MFC best to do this in OnInitDialog.


"GuitarBill" <GuitarBill_at_cox_dot_net> wrote in message
news:eRjxVerpEHA.2636@TK2MSFTNGP09.phx.gbl...
> Is this is an MFC dialog control? If so you can map it to an integer and
set
> the default/initial value in the dialog's constructor (default is -1,
> meaning nothing selected).
>
>
> "Frank" <f_rubino@prodigy.net> wrote in message
> news:54M6d.11865$Qv5.6672@newssvr33.news.prodigy.com...
> > I am using a combo box . It functions except it does not come up with
the
> > top value of the list to be inside the visible rectangle area, that area
> is
> > blank. Can someone tell me how to have the top value appear in the combo
> > box?
> >
> >
> >
>
>



Re: combo box default value by Frank

Frank
Fri Oct 01 00:14:37 CDT 2004

Yes GuitarBill, it is a MFC dialog control. How exactly does one go about
mapping it to an integer?

"GuitarBill" <GuitarBill_at_cox_dot_net> wrote in message
news:eRjxVerpEHA.2636@TK2MSFTNGP09.phx.gbl...
> Is this is an MFC dialog control? If so you can map it to an integer and
set
> the default/initial value in the dialog's constructor (default is -1,
> meaning nothing selected).
>
>




Re: combo box default value by GuitarBill

GuitarBill
Fri Oct 01 04:19:59 CDT 2004

VC6 or 7?
Not familiar with 7 and I know this type of stuff did change...

But in 6: in ClassWizard/Member Variables select the combo box ID and 'Add
Variable', and select type 'Value'.
It will only allow mapping integer if it has the 'DropList' combo box style,
and only a CString if its a 'Dropdown' style.

Note: you can also create a 'Control' association (ie you can have both a
value mapping and a control interface), which is useful if you want to
manipulate the control, like adding items to the list.
I usually suffix control variable names with _ctrl so its clearer in the
cases when you have both (eg int m_droplist; CComboBox m_droplist_ctrl;)

Look into UpdateData() function, although this is done automatically during
InitDialog and OnOK processing... so as long as the value is set before
CDialog::OnInitDialog the control will come up with the item corresponding
to the integer; and after the dialog has been closed with an OK the integer
value will have been set as per list selection.


"Frank" <f_rubino@prodigy.net> wrote in message
news:1J57d.2008$5b1.1052@newssvr17.news.prodigy.com...
> Yes GuitarBill, it is a MFC dialog control. How exactly does one go about
> mapping it to an integer?
>
> "GuitarBill" <GuitarBill_at_cox_dot_net> wrote in message
> news:eRjxVerpEHA.2636@TK2MSFTNGP09.phx.gbl...
> > Is this is an MFC dialog control? If so you can map it to an integer and
> set
> > the default/initial value in the dialog's constructor (default is -1,
> > meaning nothing selected).
> >
> >
>
>
>