Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Changing Row Height in an owner drawn Control

, 8 Nov 2001
Changing the Row Height in an owner drawn List View Control
multiline.zip
multiline
Debug
Multiline.exe
Multiline.clw
Multiline.dsp
Multiline.dsw
Multiline.opt
Multiline.plg
res
Multiline.ico
MultilineDoc.ico
Toolbar.bmp
// MultilineView.cpp : implementation of the CMultilineView class
//

#include "stdafx.h"
#include "Multiline.h"

#include "MultilineDoc.h"
#include "MultilineView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMultilineView

IMPLEMENT_DYNCREATE(CMultilineView, CFormView)

BEGIN_MESSAGE_MAP(CMultilineView, CFormView)
	//{{AFX_MSG_MAP(CMultilineView)
	ON_BN_CLICKED(ID_POPULATE, OnPopulate)
	ON_BN_CLICKED(ID_OK, OnOk)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMultilineView construction/destruction

CMultilineView::CMultilineView()
	: CFormView(CMultilineView::IDD)
{
	//{{AFX_DATA_INIT(CMultilineView)
	//}}AFX_DATA_INIT
	// TODO: add construction code here

}

CMultilineView::~CMultilineView()
{
}

void CMultilineView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMultilineView)
	//}}AFX_DATA_MAP
}

BOOL CMultilineView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CFormView::PreCreateWindow(cs);
}

void CMultilineView::OnInitialUpdate()
{
	CFormView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();
	ResizeParentToFit();

	m_ListCtrl.SubclassDlgItem(IDC_LIST, this) ;
	m_ListCtrl.SetNoOfLinesPerRow(2) ;
	m_ListCtrl.SetNoOfColumns(3) ;
	m_ListCtrl.SetNoOfRows(2) ;
	m_ListCtrl.OnInitialUpdate() ;
}

/////////////////////////////////////////////////////////////////////////////
// CMultilineView printing

BOOL CMultilineView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CMultilineView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CMultilineView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

void CMultilineView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/)
{
	// TODO: add customized printing code here
}

/////////////////////////////////////////////////////////////////////////////
// CMultilineView diagnostics

#ifdef _DEBUG
void CMultilineView::AssertValid() const
{
	CFormView::AssertValid();
}

void CMultilineView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}

CMultilineDoc* CMultilineView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMultilineDoc)));
	return (CMultilineDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMultilineView message handlers

void CMultilineView::OnPopulate() 
{
	// TODO: Add your control notification handler code here
	
}

void CMultilineView::OnOk() 
{
	// TODO: Add your control notification handler code here
	
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Uwe Keim
Chief Technology Officer Zeta Producer Desktop CMS
Germany Germany
Uwe does programming since 1989 with experiences in Assembler, C++, MFC and lots of web- and database stuff and now uses ASP.NET and C# extensively, too. He has also teached programming to students at the local university.
 
In his free time, he does climbing, running and mountain biking. Recently he became a father of a cute boy.
 
Some cool, free software from us:
 
Free Test Management Software - Intuitive, competitive, Test Plans. Download now!  
Homepage erstellen - Intuitive, very easy to use. Download now!  
Send large Files online for free by Email
Offline-Homepage-Baukasten

| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 9 Nov 2001
Article Copyright 2001 by Uwe Keim
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid