How to disable NextPage button in Print Preview.
Ajay K Sanghi -- sanghi@giasdl01.vsnl.net.in Friday, February 07, 1997 Environment : VC++ 4.0, Windows 95. Hello, My requirement is to disable the NextPage button during print preview. I am doing some processing in CMyView::OnPrint. so I do not want the user to select next page before my print processing for the current page is completed. So, I want to disable the NextPage button in start of CMyView::OnPrint and enable it back when I'm done with my print processing. My printing process is highly dependant on sequencial occurance of page number, so if user keeps on pressing NextPage button, during the print process of current page, then next OnPrint() will be called for a non sequencial page number, which I do not want. Example : If my print processing is done for current page e.g Page No. 1 and user presses the NextPage button four times, then my next OnPrint() function is called for Page No. 9 which I do not want to happen. Note : I do not want to put a WaitCursor here. What do I need to do ? Thank you, ashok email: sanghi@giasdl01.vsnl.net.in
Vic Broquard -- vBroquard@flink.com Sunday, February 09, 1997 mfc-l@netcom.com wrote: > > Environment : VC++ 4.0, Windows 95. > > Hello, > > My requirement is to disable the NextPage button during print preview. > I am doing some processing in CMyView::OnPrint. so I do not want the > user to select next page before my print processing for the current > page is completed. You might try putting in an on update command handler for NextPage. When you enter OnPrint and want to gray out the NextPage button, set a flag that the update command handler checks. When finished, clear that flag. The update handler checks that flag. If it is set, gray it out; if cleared, pass the message along to the normal handler you have installed that checks for further pages. Vic
Dulepov Dmitry -- dima@ssm6000.samsung.ru Monday, February 10, 1997 [Mailer: "Groupware E-Mail". Version 1.03.000] > [From: Ajay K Sanghi > >My requirement is to disable the NextPage button during print preview. >I am doing some processing in CMyView::OnPrint. so I do not want the >user to select next page before my print processing for the current >page is completed. > >So, I want to disable the NextPage button in start of CMyView::OnPrint >and enable it back when I'm done with my print processing. > >My printing process is highly dependant on sequencial occurance of page >number, so if user keeps on pressing NextPage button, during the print >process of current page, then next OnPrint() will be called for a non >sequencial page number, which I do not want. > >Example : >If my print processing is done for current page e.g Page No. 1 and user >presses the NextPage button four times, then my next OnPrint() function >is called for Page No. 9 which I do not want to happen. > >Note : I do not want to put a WaitCursor here. > >What do I need to do ? > >Thank you, > > >ashok >email: sanghi@giasdl01.vsnl.net.in Use CPrintInfo::SetMaxPage() in CYourView::OnPrepareDC(). Dmitry A. Dulepov Samsung Electronics Co., Ltd. Russian Research Center Phone: +7 (095) 213-9207 Fax: +7 (095) 213-9196 E-mail: dima@src.samsung.ru ====================================
Become an MFC-L member | Вернуться в корень Архива |