|
|
|
Main Window scrollbar
Started by agenore at 05-01-2006 10:02 AM. Topic has 5 replies.
|
|
05-01-2006, 10:02 AM
|
agenore

Joined on 03-21-2006
Parma
Posts 26
|
Main Window scrollbar
|
|
|
|
|
Hi, I have done a simple MDI Application, now....how can I do to put the scrollbar on my main window? If I move the child window over the border it is not appear.
|
|
|
|
|
Report
|
|
|
|
05-02-2006, 10:01 AM
|
Yasir
Joined on 03-15-2006
Posts 44
|
Re: Main Window scrollbar
|
|
|
|
|
I will give you general idea how to do it. then u consult msdn accordingly if u face any problem then paste it here.
first of all you need to write your own handlers for folowing function in CMainFrame class. ie
OnHScroll
OnVScroll
In OnCreate function enable the scrolling by calling enablescrollbar() function.
Then in those function you override handle the scrolling tasks. by calling the two functions.
SetScrollPos()
ScrollWindow()
have a look on those functions and if you get any idea let me know.
Best Regards
-Yasir
|
|
|
|
|
Report
|
|
|
|
05-04-2006, 8:32 AM
|
agenore

Joined on 03-21-2006
Parma
Posts 26
|
Re: Main Window scrollbar
|
|
|
|
|
Hi, I red MSDN but I didn't understand how I have to do for realize that. I can do it on a child window by the method PreCreateWindow. In the main window it dosen't work. I have continue to read more tutorial ed code but I haven't found nothing of usefull.
|
|
|
|
|
Report
|
|
|
|
05-10-2006, 3:46 AM
|
Yasir
Joined on 03-15-2006
Posts 44
|
Re: Main Window scrollbar
|
|
|
|
|
Hi,
Sorry for being late i was ill and was unable to use my computer for some days. :S i feel better now it was just fever and throad infection.
Regarding adding scroll bars just add the following code.
find CmainFrame class and in its onCreate method add following lines after the creating of frame or at end of function.
EnableScrollBarCtrl(SB_VERT);
ShowScrollBar(SB_VERT);
This is for Vertical scrollBar and for horizontal scroll bars user VERT as HORZ
one more thing you need to do is open the class wizard and then add the two event handling function ie onVScroll and onHScroll on the events of WM_VSCROLL and WM_VSCROLL. and then do what do u want to do while scroll bar is clicked.
If u need any further assistance or dont understand reply back to me.
Best Regards
-Yasir
|
|
|
|
|
Report
|
|
|
|
05-10-2006, 7:45 AM
|
Anuj
Joined on 05-10-2006
Posts 1
|
Re: Main Window scrollbar
|
|
|
|
|
|
|
|
05-11-2006, 6:02 AM
|
agenore

Joined on 03-21-2006
Parma
Posts 26
|
Re: Main Window scrollbar
|
|
|
|
|
Hi, I have found another way. By the structure 'creatrestruct' on the method 'PreCreateWindow' I set the attribute .style for use the scrollbar. I have left how to manage correctly the scrollbar, but it work. I will try your tip too. Thanks.
|
|
|
|
|
Report
|
|
|
|
|
Codersource.Net » Programming » MFC Programming » Main Window scrollbar
|
|
| |
|