Click here to Skip to main content
15,888,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
General_beginthread Pin
murali_utr11-Jan-04 22:32
murali_utr11-Jan-04 22:32 
GeneralRe: _beginthread Pin
Mahesh Varma11-Jan-04 22:54
Mahesh Varma11-Jan-04 22:54 
GeneralShow PropertyPage of an activeX control Pin
hajer11-Jan-04 22:31
hajer11-Jan-04 22:31 
GeneralRe: About the PostThreadMessage(...)??? Pin
Michael Dunn11-Jan-04 21:04
sitebuilderMichael Dunn11-Jan-04 21:04 
GeneralRe: About the PostThreadMessage(...)??? Pin
KarstenK12-Jan-04 4:25
mveKarstenK12-Jan-04 4:25 
GeneralListBox in ComboBox Pin
Tonnystar11-Jan-04 20:51
Tonnystar11-Jan-04 20:51 
GeneralRe: ListBox in ComboBox Pin
Jijo.Raj11-Jan-04 21:05
Jijo.Raj11-Jan-04 21:05 
GeneralRe: ListBox in ComboBox Pin
22491711-Jan-04 21:53
22491711-Jan-04 21:53 
You can change the width and height of the dropdown listbox with following two functions in CComboBox.

to change the dropdown list width
to the longest string in the combobox
<br />
// The pointer to my combo box.<br />
extern CComboBox* pmyComboBox;<br />
<br />
// Find the longest string in the combo box.<br />
CString str;<br />
CSize   sz;<br />
int     dx=0;<br />
CDC*    pDC = pmyComboBox->GetDC();<br />
for (int i=0;i < pmyComboBox->GetCount();i++)<br />
{<br />
   pmyComboBox->GetLBText( i, str );<br />
   sz = pDC->GetTextExtent(str);<br />
<br />
   if (sz.cx > dx)<br />
      dx = sz.cx;<br />
}<br />
pmyComboBox->ReleaseDC(pDC);<br />
<br />
// Adjust the width for the vertical scroll bar and the left and right border.<br />
dx += ::GetSystemMetrics(SM_CXVSCROLL) + 2*::GetSystemMetrics(SM_CXEDGE);<br />
<br />
// Set the width of the list box so that every item is completely visible.<br />
pmyComboBox->SetDroppedWidth(dx);<br />


Change the each item height of dropdown list to 50px
<br />
// The pointer to my combo box.<br />
extern CComboBox* pmyComboBox;<br />
<br />
// Set the height of every item to be the<br />
// vertical size of the item's text extent.<br />
CString str;<br />
CSize   sz;<br />
int     dx=0;<br />
CDC*    pDC = pmyComboBox->GetDC();<br />
for (int i=0;i < pmyComboBox->GetCount();i++)<br />
{<br />
   pmyComboBox->SetItemHeight( i, 50 );<br />
}<br />
pmyComboBox->ReleaseDC(pDC);<br />
<br />
<br />







greatest thing is to do wot others think you cant Smile | :)
suhredayan@omniquad.com

GeneralRe: ListBox in ComboBox Pin
Tonnystar19-Jan-04 4:48
Tonnystar19-Jan-04 4:48 
GeneralGetExtent -&gt; SetExtent Pin
El'Cachubrey11-Jan-04 20:27
El'Cachubrey11-Jan-04 20:27 
GeneralHi Pin
Ruchit Sharma11-Jan-04 20:19
Ruchit Sharma11-Jan-04 20:19 
GeneralRe: Hi Pin
Michael Dunn11-Jan-04 21:02
sitebuilderMichael Dunn11-Jan-04 21:02 
GeneralSHBrowseForFolder Pin
murali_utr11-Jan-04 20:16
murali_utr11-Jan-04 20:16 
GeneralRe: SHBrowseForFolder Pin
Ryan Binns11-Jan-04 20:47
Ryan Binns11-Jan-04 20:47 
GeneralRe: SHBrowseForFolder Pin
murali_utr11-Jan-04 21:55
murali_utr11-Jan-04 21:55 
GeneralCreateProcess Pin
SiddharthAtw11-Jan-04 19:22
SiddharthAtw11-Jan-04 19:22 
GeneralRe: CreateProcess Pin
Jijo.Raj11-Jan-04 19:49
Jijo.Raj11-Jan-04 19:49 
GeneralRe: CreateProcess Pin
Selvam R11-Jan-04 19:52
professionalSelvam R11-Jan-04 19:52 
GeneralCOleServerDoc Pin
kevcs211-Jan-04 18:52
kevcs211-Jan-04 18:52 
GeneralOpenDocument Pin
kevcs211-Jan-04 18:41
kevcs211-Jan-04 18:41 
GeneralRe: OpenDocument Pin
Roger Allen11-Jan-04 23:58
Roger Allen11-Jan-04 23:58 
Generalload bitmapfile on dialog at runtime.. Pin
swarnamanoo11-Jan-04 18:22
swarnamanoo11-Jan-04 18:22 
GeneralRe: load bitmapfile on dialog at runtime.. Pin
Jijo.Raj11-Jan-04 18:45
Jijo.Raj11-Jan-04 18:45 
GeneralRe: load bitmapfile on dialog at runtime.. Pin
swarnamanoo11-Jan-04 20:08
swarnamanoo11-Jan-04 20:08 
GeneralRe: load bitmapfile on dialog at runtime.. Pin
Ryan Binns11-Jan-04 20:49
Ryan Binns11-Jan-04 20:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.