Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: compare current date with listed date Pin
ThatsAlok7-Mar-05 2:15
ThatsAlok7-Mar-05 2:15 
GeneralRe: compare current date with listed date Pin
shaans7-Mar-05 16:39
shaans7-Mar-05 16:39 
GeneralRe: compare current date with listed date Pin
ThatsAlok7-Mar-05 18:27
ThatsAlok7-Mar-05 18:27 
Generaltwo digits in edit control Pin
Musen806-Mar-05 20:51
Musen806-Mar-05 20:51 
GeneralRe: two digits in edit control Pin
Cedric Moonen6-Mar-05 21:30
Cedric Moonen6-Mar-05 21:30 
GeneralRe: two digits in edit control Pin
Steen Krogsgaard6-Mar-05 21:39
Steen Krogsgaard6-Mar-05 21:39 
GeneralAutomatic scrolling in ListBox Pin
Majid Shahabfar6-Mar-05 20:40
Majid Shahabfar6-Mar-05 20:40 
GeneralRe: Automatic scrolling in ListBox Pin
V.6-Mar-05 22:26
professionalV.6-Mar-05 22:26 
you have to do it manually:

something like:
void DlgFlexListSelectValue::SetHorizontalScrollBar(){<br />
	//Next is to set the horizontal scroll bar<br />
	//Find the longest string in the list box.<br />
	CString str;<br />
	CSize sz;<br />
	int dx = 0;<br />
	TEXTMETRIC tm;<br />
	CDC* pDC = m_valueList.GetDC();<br />
	CFont* pFont = m_valueList.GetFont();<br />
<br />
	//Select the listbox font, save the old font<br />
	CFont* pOldFont = pDC->SelectObject(pFont);<br />
	//Get the text metrics for avg char width<br />
	pDC->GetTextMetrics(&tm); <br />
<br />
	for(int i = 0; i < m_valueList.GetCount(); i++){<br />
		m_valueList.GetText(i, str);<br />
		sz = pDC->GetTextExtent(str);<br />
<br />
		//Add the avg width to prevent clipping<br />
		sz.cx += tm.tmAveCharWidth;<br />
<br />
		if(sz.cx > dx){<br />
			dx = sz.cx;<br />
		}											//end if<br />
	}												//end for<br />
<br />
	//Select the old font back into the DC<br />
	pDC->SelectObject(pOldFont);<br />
	m_valueList.ReleaseDC(pDC);<br />
	//Set the horizontal extent so every character of all strings <br />
	//can be scrolled to.<br />
	m_valueList.SetHorizontalExtent(dx);<br />
}													//end function SetHorizontalScrollBar


call the function when you have loaded the listbox.
it's on MSDN somewhere.

good luck.

No hurries, no worries.
GeneralRe: Automatic scrolling in ListBox Pin
Majid Shahabfar7-Mar-05 0:56
Majid Shahabfar7-Mar-05 0:56 
GeneralRe: Automatic scrolling in ListBox Pin
V.7-Mar-05 1:18
professionalV.7-Mar-05 1:18 
GeneralRe: Automatic scrolling in ListBox Pin
Jetli Jerry6-Mar-05 23:45
Jetli Jerry6-Mar-05 23:45 
Generalmemory management utilization probz!!!!! Pin
namaskaaram6-Mar-05 19:13
namaskaaram6-Mar-05 19:13 
GeneralRe: memory management utilization probz!!!!! Pin
Bob Stanneveld6-Mar-05 20:24
Bob Stanneveld6-Mar-05 20:24 
GeneralRe: memory management utilization probz!!!!! Pin
namaskaaram6-Mar-05 21:45
namaskaaram6-Mar-05 21:45 
GeneralRe: memory management utilization probz!!!!! Pin
Bob Stanneveld7-Mar-05 20:35
Bob Stanneveld7-Mar-05 20:35 
GeneralRe: memory management utilization probz!!!!! Pin
namaskaaram8-Mar-05 16:32
namaskaaram8-Mar-05 16:32 
GeneralRe: memory management utilization probz!!!!! Pin
David Crow7-Mar-05 10:52
David Crow7-Mar-05 10:52 
GeneralMouse Cursor Hot Spot Pin
User 1026746-Mar-05 16:29
User 1026746-Mar-05 16:29 
GeneralRe: Mouse Cursor Hot Spot Pin
PJ Arends6-Mar-05 16:35
professionalPJ Arends6-Mar-05 16:35 
GeneralMessage Closed Pin
6-Mar-05 16:45
User 1026746-Mar-05 16:45 
GeneralRe: Mouse Cursor Hot Spot Pin
PJ Arends6-Mar-05 18:03
professionalPJ Arends6-Mar-05 18:03 
GeneralCompilation from script Pin
Anonymous6-Mar-05 3:31
Anonymous6-Mar-05 3:31 
Generaltray icons disappearing Pin
Kevin Tambascio6-Mar-05 3:09
Kevin Tambascio6-Mar-05 3:09 
GeneralCListCtrl Pin
super_pointer6-Mar-05 2:38
super_pointer6-Mar-05 2:38 
GeneralRe: CListCtrl Pin
PJ Arends6-Mar-05 12:26
professionalPJ Arends6-Mar-05 12:26 

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.