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

Print Search « Previous Thread Next Thread »
   05-01-2006, 10:02 AM
agenore is not online. Last active: 7/24/2006 9:38:58 AM agenore



Top 10 Posts
Joined on 03-21-2006
Parma
Posts 26
Sad [:(] 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 is not online. Last active: 11/16/2006 10:02:40 AM Yasir

Top 10 Posts
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 is not online. Last active: 7/24/2006 9:38:58 AM agenore



Top 10 Posts
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 is not online. Last active: 11/16/2006 10:02:40 AM Yasir

Top 10 Posts
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 is not online. Last active: 5/15/2006 4:50:03 AM Anuj

Top 75 Posts
Joined on 05-10-2006
Posts 1
Re: Main Window scrollbar

Hi dear,

Can i help u.


   Report 
   05-11-2006, 6:02 AM
agenore is not online. Last active: 7/24/2006 9:38:58 AM agenore



Top 10 Posts
Joined on 03-21-2006
Parma
Posts 26
Geeked [8-|] 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

MENU
Home
MFC 
C++
.Net
WIN32
Programming
Forum
My Articles
Welcome to Codersource.Net Login | Register | Faq  

Google
 

NOTES:


Thanks for visiting our CoderSource.net. This site will be improved with more articles. Interested visitors can also submit their articles through the Submit Article link.Your article will also be published after due consideration by the editor. 

© Copyright 2003. All rights on content reserved by CoderSource.net. Contact    About Us