Pls help, I am very new for programming.
I am writing a dialog-based program for Pocket PC (Win CE 3.0) using MFC. I am able to get the scrollbar for one of the child dialog embedded in the overlapped dialog. However, the scrollbar is not scrolling at all (the window is not moving when I scroll!!!). What did I do wrong? Here is my code for the WM_VSCROLL:
First I wanted to say what a great article you have
For those that have dialogs bigger than their screen and
are having trouble getting to be able to see the part off
the screen, the secret is to insure to size of the dialog
that initially appears fits on the screen.
Here are the steps to accomplish this:
1. Add a message handler for WM_SHOWWINDOW
2. In that handler add the following code - note that I
am modifying the height parameters only. It should be
obvious the same thing can be done for the width.
HWND hWndEntireScreen = NULL;
int nHeightOfEntireScreen = 0,nHeightOfMyDlg = 0;
int nAdjHeight = 0;
int nMaxDesiredHeight = 0;
//In my case, I want the height to be no more than 90% of the entire screen
nMaxDesiredHeight = (int)(0.9 * (double)nHeightOfEntireScreen);
if (nAdjHeight >= nMaxDesiredHeight)
nAdjHeight = nMaxDesiredHeight;
3. When your dialog comes up it will fit on top the
screen and now you can scroll down to the bottom of
Answer to person who wants to add 200 controls on 8 pages:
It is definitely possible and you will not meet any
CDialog limitations. Use my code above and you'll be fine.
i am using 60 contols in one dialog box ...so i using ScrollDialog class...here i modified dialog templates(co ordinates) using resource editor..but it looks bad ..it's fit to screen also ..so i want to minimize the dialog box when i am calling this dialog box ...
if i mentioned less coordinates in resource file i did't use scrollbar functionality ...
i tried lot of ways ..but not success...
Is it possible to have the scrolling capability like a true view window. What I mean is that, If I dynamically add controls into the dialog (100s of them), can I scroll and view all the controls, currently it limits the max size to the screen (when maximised)
I have opened a new project with CFormView as a base class & i have inserted Dialog box. I want the HScroll & VScroll functionality on this dialog box. If i choose CScroll as the derived class, DoModal will not work in order to open another Dialog box.
I want this fuctionality in order to show a large number of outputs in the same window.
And I want the second way of implementing the DoModal(), to open another dailog box.