Click here to Skip to main content
15,917,177 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 5:13
John5026-Feb-09 5:13 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 5:50
professionalStuart Dootson6-Feb-09 5:50 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 6:24
John5026-Feb-09 6:24 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 7:16
professionalStuart Dootson6-Feb-09 7:16 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 7:35
John5026-Feb-09 7:35 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 8:03
professionalStuart Dootson6-Feb-09 8:03 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 4:14
John5028-Feb-09 4:14 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 6:38
professionalStuart Dootson8-Feb-09 6:38 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 7:05
John5028-Feb-09 7:05 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 8:01
professionalStuart Dootson8-Feb-09 8:01 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 9:59
John5028-Feb-09 9:59 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 10:28
professionalStuart Dootson8-Feb-09 10:28 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 22:07
professionalStuart Dootson8-Feb-09 22:07 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5029-Feb-09 3:05
John5029-Feb-09 3:05 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John50210-Feb-09 7:00
John50210-Feb-09 7:00 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson10-Feb-09 8:17
professionalStuart Dootson10-Feb-09 8:17 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John50210-Feb-09 20:45
John50210-Feb-09 20:45 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson10-Feb-09 21:01
professionalStuart Dootson10-Feb-09 21:01 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John50211-Feb-09 1:56
John50211-Feb-09 1:56 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson11-Feb-09 2:12
professionalStuart Dootson11-Feb-09 2:12 
Hmmm - this worked fine for me:

  1. Create the check boxes in OnInitDialog:
    CRect rcCheck1(baseSize_);
    rcCheck1.bottom /= 2;
    CRect rcCheck2;
    rcCheck2.SubtractRect(baseSize_, rcCheck1);
    rcCheck1.left = rcCheck1.right - 100;
    rcCheck2.left = rcCheck2.right - 100;
    check1_.Create(_T("1"), WS_CHILD|WS_VISIBLE|BS_CHECKBOX, rcCheck1, this, 101);
    check2_.Create(_T("2"), WS_CHILD|WS_VISIBLE|BS_CHECKBOX, rcCheck2, this, 102);
    
  2. Draw the images 100 pixels narrower (as I've made the checkboxes 100 pixels wide). I added the following two lines in OnPaint right before the OffsetRect method calls to do that:
    rcImage1.right -=100;
    rcImage2.right -=100;
    


Oh, and check1_ and check2_ are members of the dialog class, of type CButton.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John50212-Feb-09 1:01
John50212-Feb-09 1:01 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson12-Feb-09 1:02
professionalStuart Dootson12-Feb-09 1:02 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John50215-Feb-09 23:51
John50215-Feb-09 23:51 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson16-Feb-09 0:04
professionalStuart Dootson16-Feb-09 0:04 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John50216-Feb-09 0:45
John50216-Feb-09 0:45 

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.