How to print a CSliderCtrl common control 
Author Message
 How to print a CSliderCtrl common control

Hi,
   I new to this printing stuff so this may be a very simple question.   I
have generated an MDI MFC application using the VStudio wizards with the
print/preview options enabled. I added a CSliderCtrl to the view class and
its displayed on sceen and in preview mode, all's OK.

The problem is when I print,  the CSliderCtrl is not printed. What am I
doing wrong?  Should CSliderCtrl's OnDraw() method handle the paining to the
printDC for me or is it my responsibility?

[code follows below]

void CTestView::OnInitialUpdate()
{
  CView::OnInitialUpdate();

  m_slider = new CSliderCtrl;
  m_slider->Create(TBS_HORZ | TBS_BOTH  | WS_CHILD | WS_VISIBLE | WS_BORDER,
                                             CRect(310, 310, 500, 340),
this, 2);

Quote:
}

...............
...............
void CTestView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
  CRect rectt;
  GetClientRect( rectt );
  CSize pageSize(pDC->GetDeviceCaps(PHYSICALWIDTH),
pDC->GetDeviceCaps(PHYSICALHEIGHT));
  pDC->SetMapMode(MM_ANISOTROPIC);
  pDC->SetWindowExt(rectt.Width(), rectt.Height() );
  pDC->SetViewportExt(pageSize.cx, pageSize.cy);
  pDC->SetViewportOrg(0,0);

  m_slider->Print( pDC, PRF_OWNED | PRF_CLIENT );

  CView::OnPrint(pDC, pInfo);

Quote:
}



Tue, 22 Jul 2003 09:17:23 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How do I add an edit control to the common print dialog

2. Printing Common Controls

3. Controls Created Under Common Control Manifest

4. Common Controls in ActiveX Control

5. why my Composite Control can't capture the command message send by child common control

6. Qn on Slider Control ( CSliderCtrl ) in VC++ dialog box

7. Qn on Slider Control ( CSliderCtrl ) in VC++ dialog box

8. CSliderCtrl out of Control

9. How do i just allow for cursor control on a CSliderCtrl

10. customizing common print dialog

11. Customizing the Common Print Dialog Box - Problem with Collate Icon

12. Customizing the common print dialog box

 

 
Powered by phpBB® Forum Software