Click here to Skip to main content
15,921,203 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: menu bar Pin
Joaquín M López Muñoz31-Jan-02 5:19
Joaquín M López Muñoz31-Jan-02 5:19 
GeneralRe: menu bar Pin
aleyah31-Jan-02 5:23
aleyah31-Jan-02 5:23 
GeneralJoaquín M López Muñoz LOOK HERE! (or anyone) Pin
Rickard Andersson2031-Jan-02 1:17
Rickard Andersson2031-Jan-02 1:17 
GeneralRe: Joaquín M López Muñoz LOOK HERE! (or anyone) Pin
Joaquín M López Muñoz31-Jan-02 2:41
Joaquín M López Muñoz31-Jan-02 2:41 
GeneralRe: Joaquín M López Muñoz LOOK HERE! (or anyone) Pin
Rickard Andersson2031-Jan-02 3:18
Rickard Andersson2031-Jan-02 3:18 
GeneralRe: Joaquín M López Muñoz LOOK HERE! (or anyone) Pin
Joaquín M López Muñoz31-Jan-02 3:22
Joaquín M López Muñoz31-Jan-02 3:22 
GeneralCListCtrl Question Pin
Paresh Solanki31-Jan-02 0:50
Paresh Solanki31-Jan-02 0:50 
GeneralRe: CListCtrl Question Pin
Roger Allen31-Jan-02 1:35
Roger Allen31-Jan-02 1:35 
You have to handle the message NK_ENDTRACK, which is sent when a column has been re-sized. The header control can be a bit funny in NT and not send the message with the correct control id (it has it set to 0). Here is some code which I have used in the past:

// in your OnInitDialog etc
	m_Methods.GetHeaderCtrl()->SetDlgCtrlID(m_Methods.GetDlgCtrlID());	

void CSamplesFloat::OnEndtrackMethodList(NMHDR* pNMHDR, LRESULT* pResult) 
{
	//HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR;
	// TODO: Add your control notification handler code here
	CHeaderCtrl* pHeaderCtrl = m_Methods.GetHeaderCtrl();
	if (pHeaderCtrl != NULL)
		{
		int  nColumnCount = pHeaderCtrl->GetItemCount();
		int	width ;
		for (int i = 0 ; i < nColumnCount ; i++)
			{
			width = m_Methods.GetColumnWidth(i) ;
			m_OtherCtrl.SetColumnWidth(i, width) ;
			}
		}
	*pResult = 0;
}


You just need to map the HDN_ENDTRACk for both list controls, and get one to size the columns of the other in each function.



Roger Allen
Sonork 100.10016

If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
GeneralRe: CListCtrl Question Pin
Paresh Solanki31-Jan-02 3:16
Paresh Solanki31-Jan-02 3:16 
GeneralUnicode in combobox Pin
Jon Schuringa31-Jan-02 0:38
Jon Schuringa31-Jan-02 0:38 
QuestionMFC7.0? Pin
Joan M31-Jan-02 0:01
professionalJoan M31-Jan-02 0:01 
AnswerRe: MFC7.0? Pin
Mazdak31-Jan-02 1:22
Mazdak31-Jan-02 1:22 
GeneralWindow Message Pin
wangyiming30-Jan-02 20:29
wangyiming30-Jan-02 20:29 
GeneralRe: Window Message Pin
Rickard Andersson2030-Jan-02 21:12
Rickard Andersson2030-Jan-02 21:12 
GeneralThank: Vladimir Georgiev, Rickard Andersson Pin
wangyiming30-Jan-02 23:59
wangyiming30-Jan-02 23:59 
GeneralRe: Window Message Pin
Vladimir Georgiev30-Jan-02 21:46
Vladimir Georgiev30-Jan-02 21:46 
QuestionHow can I get a rotated region? Pin
wangyiming30-Jan-02 20:28
wangyiming30-Jan-02 20:28 
AnswerRe: How can I get a rotated region? Pin
Joaquín M López Muñoz30-Jan-02 20:45
Joaquín M López Muñoz30-Jan-02 20:45 
GeneralRe: How can I get a rotated region? Pin
wangyiming30-Jan-02 20:56
wangyiming30-Jan-02 20:56 
Generalneed help!! Pin
Cnoob30-Jan-02 20:11
Cnoob30-Jan-02 20:11 
GeneralRe: need help!! Pin
Jon Sagara30-Jan-02 20:22
Jon Sagara30-Jan-02 20:22 
GeneralRe: need help!! Pin
Vladimir Georgiev30-Jan-02 21:49
Vladimir Georgiev30-Jan-02 21:49 
GeneralRetrieving System Font List Pin
John Clump30-Jan-02 19:25
John Clump30-Jan-02 19:25 
GeneralRe: Retrieving System Font List Pin
Jon Sagara30-Jan-02 19:36
Jon Sagara30-Jan-02 19:36 
GeneralRe: Retrieving System Font List Pin
wangyiming30-Jan-02 20:18
wangyiming30-Jan-02 20:18 

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.