Click here to Skip to main content
15,917,968 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: full screen Pin
Shog917-Aug-02 7:48
sitebuilderShog917-Aug-02 7:48 
GeneralCDHTMLDialog issue Pin
Emilio Guijarro17-Aug-02 6:25
Emilio Guijarro17-Aug-02 6:25 
GeneralRe: CDHTMLDialog issue Pin
Shog917-Aug-02 7:12
sitebuilderShog917-Aug-02 7:12 
GeneralRe: CDHTMLDialog issue Pin
Emilio Guijarro18-Aug-02 7:15
Emilio Guijarro18-Aug-02 7:15 
GeneralRe: CDHTMLDialog issue Pin
Shog918-Aug-02 8:36
sitebuilderShog918-Aug-02 8:36 
GeneralRe: CDHTMLDialog issue Pin
Emilio Guijarro19-Aug-02 6:31
Emilio Guijarro19-Aug-02 6:31 
GeneralMy ado stream object is not happy Pin
nss17-Aug-02 6:02
nss17-Aug-02 6:02 
GeneralScollbox size and position Pin
insanely42017-Aug-02 5:45
insanely42017-Aug-02 5:45 
Greetings...

I have a custom control similar to a grid and I am using only Win32 techniques. It has two scrollbars - horizontal and vertical on top and bottom.

When I have more rows to show then the client area I show make my vertical scrollbar visible using ShowWindow function with SW_SHOW flag. I am using the following method to set the size of scroll box of the vertical scroll bar.

#define CUST_DEFHIEGHT 25 // the defaul height of each row in the window.
#define CUST_DEFWIDTH 50 // the default width of wach column in the window.

int nRowNotVis; // how many rows are not visible.
SCROLLINFO scf;

// Get the total client rect of the window.
GetClientRect ( hwnd, &rectWin ); // where hwnd is my custom control.

// Then I calculate how many rows are not being shown.
nRowNotVis = (INT)((row * CUST_DEFHIEGHT) - (rectWin.bottom-(2*CUST_DEFHIEGHT)))/CUST_DEFHIEGHT;

// where row is the total number of rows my Grid has.
// I have left 1 row space in the top and bottom each coz I need them for other purpose.

// Then I use the following code to set the info abdout the scrollbar.
scf.cbSize = sizeof ( SCROLLINFO );
scf.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
scf.nPage = row-nRowNotVis;
scf.nMin = 0;
scf.nMax = nRowNowVis+1;
scf.nPos = 0;

SendMessage ( hwndVScroll, SBM_SETSCROLLINFO, (WPARAM)FALSE, (LPARAM)&scf );

// Doing this does not change the size of the scroll box in the scroll bar and
// the size remains the same as the scrollbar.

What is going wrong ?

The same thing happens when I use set the value of the Horizontal scrollbar

// now for the horizontal scroll bar.
scf.cbSize = sizeof ( SCROLLINFO );
scf.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;
scf.nPage = col-nCol;
scf.nMin = 0;
scf.nMax = nCol+1;
scf.nPos = 0;

Where nCol is the number of columns not shown in the Window and col is the number of column in the window ?

Please help me ?

I am able to scroll the contents in the window properly but my scrollbox size is not getting effected so I am not able to position it properly also.

Thanks in advance.

Ritesh Nadhani

GeneralRe: Scollbox size and position Pin
mishgun17-Aug-02 7:51
mishgun17-Aug-02 7:51 
GeneralRe: Scollbox size and position Pin
dlhson17-Aug-02 8:37
dlhson17-Aug-02 8:37 
GeneralDWORD to string and std::string Pin
Shamoon17-Aug-02 5:39
Shamoon17-Aug-02 5:39 
GeneralRe: DWORD to string and std::string Pin
Anonymous17-Aug-02 6:07
Anonymous17-Aug-02 6:07 
GeneralRe: DWORD to string and std::string Pin
mishgun17-Aug-02 7:48
mishgun17-Aug-02 7:48 
QuestionHow to implement a 'please wait' dialog.. Pin
Tre K Renegade17-Aug-02 4:58
Tre K Renegade17-Aug-02 4:58 
AnswerRe: How to implement a 'please wait' dialog.. Pin
Michael Dunn17-Aug-02 5:16
sitebuilderMichael Dunn17-Aug-02 5:16 
AnswerRe: How to implement a 'please wait' dialog.. Pin
dlhson17-Aug-02 8:43
dlhson17-Aug-02 8:43 
Questionhow to access bad pointers? Pin
includeh1017-Aug-02 3:28
includeh1017-Aug-02 3:28 
AnswerRe: how to access bad pointers? Pin
Michael P Butler17-Aug-02 3:45
Michael P Butler17-Aug-02 3:45 
GeneralRe: how to access bad pointers? Pin
includeh1017-Aug-02 4:24
includeh1017-Aug-02 4:24 
GeneralRe: how to access bad pointers? Pin
mishgun17-Aug-02 4:34
mishgun17-Aug-02 4:34 
GeneralRe: how to access bad pointers? Pin
dlhson17-Aug-02 8:49
dlhson17-Aug-02 8:49 
AnswerRe: how to access bad pointers? Pin
Philippe Mori17-Aug-02 10:10
Philippe Mori17-Aug-02 10:10 
AnswerRe: how to access bad pointers? Pin
Philip Patrick17-Aug-02 11:06
professionalPhilip Patrick17-Aug-02 11:06 
QuestionCan anyone suggest how to execute warm booting using address pointer Pin
Pankaj Singh17-Aug-02 2:36
Pankaj Singh17-Aug-02 2:36 
AnswerRe: Can anyone suggest how to execute warm booting using address pointer Pin
dlhson17-Aug-02 8:51
dlhson17-Aug-02 8:51 

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.