Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get the menu of the ChildFrame in MDI [modified] Pin
raycadarena28-May-06 20:07
raycadarena28-May-06 20:07 
GeneralRe: How to get the menu of the ChildFrame in MDI [modified] Pin
bob1697229-May-06 7:34
bob1697229-May-06 7:34 
QuestionHow i make a scroll bar to scroll down by itself? Pin
Immunity1828-May-06 14:14
Immunity1828-May-06 14:14 
AnswerRe: How i make a scroll bar to scroll down by itself? Pin
bob1697228-May-06 14:30
bob1697228-May-06 14:30 
GeneralRe: How i make a scroll bar to scroll down by itself? [modified] Pin
Immunity1828-May-06 14:36
Immunity1828-May-06 14:36 
GeneralRe: How i make a scroll bar to scroll down by itself? [modified] Pin
bob1697228-May-06 15:01
bob1697228-May-06 15:01 
GeneralRe: How i make a scroll bar to scroll down by itself? [modified] Pin
Immunity1828-May-06 15:06
Immunity1828-May-06 15:06 
GeneralRe: How i make a scroll bar to scroll down by itself? [modified] Pin
bob1697228-May-06 15:27
bob1697228-May-06 15:27 
Ok. Let's back up a bit. I'm not sure if you have a scrollbar or your dealing with the scrolling in a view so I'm going to take some liberties here and assume for the moment that your wanting to scroll a view.

Start a new MFC/SDI app and take all the defaults except on the last screen derive your class from CScrollView.

In the CYourView::OnInitialUpdate() you'll find some code that sets the scrollsizes to some default values. CWnd provides some functions similar to CScrollBar's methods. Modify the code to look something like the following...

void CYourView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();

CSize sizeTotal;
// TODO: calculate the total size of this view
sizeTotal.cx = sizeTotal.cy = 2000;
this->SetScrollSizes(MM_TEXT, sizeTotal);

this->SetScrollPos(SB_HORZ,500);
this->SetScrollPos(SB_VERT,400);
}

Mess with this a for a bit. Lookup the scrolling functions for CWnd and try some of the other functions and mess with the parameters. the this-> pointer is implied but I included it to demonstrate that we're using members of CView. since CView does not have these members, you goes up the object hierarchy to CWnd which has them.

Sorry about any confusion I may have caused or introduced inadvertantly.

-- modified at 21:28 Sunday 28th May, 2006
GeneralRe: How i make a scroll bar to scroll down by itself? [modified] Pin
Immunity1828-May-06 15:32
Immunity1828-May-06 15:32 
GeneralRe: How i make a scroll bar to scroll down by itself? [modified] Pin
bob1697228-May-06 16:40
bob1697228-May-06 16:40 
QuestionProblem writing large character array to a file Pin
fourierman28-May-06 13:20
fourierman28-May-06 13:20 
AnswerRe: Problem writing large character array to a file [modified] Pin
Chris Losinger28-May-06 13:23
professionalChris Losinger28-May-06 13:23 
GeneralRe: Problem writing large character array to a file [modified] Pin
bob1697228-May-06 14:12
bob1697228-May-06 14:12 
AnswerRe: Problem writing large character array to a file [modified] Pin
bob1697228-May-06 14:17
bob1697228-May-06 14:17 
GeneralRe: Problem writing large character array to a file [modified] Pin
fourierman28-May-06 14:35
fourierman28-May-06 14:35 
GeneralRe: Problem writing large character array to a file [modified] Pin
Chris Losinger28-May-06 16:06
professionalChris Losinger28-May-06 16:06 
AnswerRe: Problem writing large character array to a file Pin
kakan28-May-06 20:49
professionalkakan28-May-06 20:49 
GeneralRe: Problem writing large character array to a file Pin
fourierman29-May-06 10:15
fourierman29-May-06 10:15 
GeneralRe: Problem writing large character array to a file Pin
kakan29-May-06 19:39
professionalkakan29-May-06 19:39 
Questionhow can i read an excell sheet from visual c# Pin
raniam28-May-06 12:48
raniam28-May-06 12:48 
AnswerRe: how can i read an excell sheet from visual c# Pin
bob1697228-May-06 12:53
bob1697228-May-06 12:53 
QuestionCListCtrl subitem problem Pin
Ivan Cachicatari28-May-06 11:15
Ivan Cachicatari28-May-06 11:15 
AnswerRe: CListCtrl subitem problem [modified] Pin
bob1697228-May-06 11:45
bob1697228-May-06 11:45 
QuestionHow i remove a part of a string Pin
Immunity1828-May-06 9:29
Immunity1828-May-06 9:29 
AnswerRe: How i remove a part of a string Pin
bob1697228-May-06 9:43
bob1697228-May-06 9:43 

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.