Click here to Skip to main content
15,921,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: square root Pin
David Crow22-Oct-03 2:39
David Crow22-Oct-03 2:39 
GeneralRe: sqaur root Pin
QuiJohn22-Oct-03 2:47
QuiJohn22-Oct-03 2:47 
General256 colors icon getting modified without a reason Pin
DaFrawg21-Oct-03 21:15
DaFrawg21-Oct-03 21:15 
GeneralRe: 256 colors icon getting modified without a reason Pin
Johnny ²21-Oct-03 21:44
Johnny ²21-Oct-03 21:44 
GeneralRe: 256 colors icon getting modified without a reason Pin
Atif Mushtaq22-Oct-03 20:16
Atif Mushtaq22-Oct-03 20:16 
GeneralRe: 256 colors icon getting modified without a reason Pin
DaFrawg27-Oct-03 1:53
DaFrawg27-Oct-03 1:53 
GeneralRe: Cbutton Pin
DaFrawg21-Oct-03 20:58
DaFrawg21-Oct-03 20:58 
GeneralTool Bar Pin
Neelesh K J Jain21-Oct-03 20:29
Neelesh K J Jain21-Oct-03 20:29 
GeneralRe: Tool Bar Pin
twing21-Oct-03 22:56
twing21-Oct-03 22:56 
Generalpostfix to infix Pin
ranjjj21-Oct-03 18:54
ranjjj21-Oct-03 18:54 
GeneralRe: postfix to infix Pin
David Crow22-Oct-03 2:33
David Crow22-Oct-03 2:33 
GeneralHelp w/ IPicture please Pin
Anonymous21-Oct-03 18:34
Anonymous21-Oct-03 18:34 
Generalassembly help Pin
Sirrius21-Oct-03 18:28
Sirrius21-Oct-03 18:28 
GeneralRe: assembly help Pin
ZoogieZork22-Oct-03 1:53
ZoogieZork22-Oct-03 1:53 
Generalcharacter set conversion(UTF8 and UCS2) Pin
convert_sg21-Oct-03 17:03
convert_sg21-Oct-03 17:03 
GeneralRe: character set conversion(UTF8 and UCS2) Pin
Joe Woodbury21-Oct-03 17:58
professionalJoe Woodbury21-Oct-03 17:58 
GeneralRe: character set conversion(UTF8 and UCS2) Pin
convert_sg21-Oct-03 19:03
convert_sg21-Oct-03 19:03 
Questionhow can i reach the same result in vc++? Pin
Habbit21-Oct-03 16:31
Habbit21-Oct-03 16:31 
AnswerRe: how can i reach the same result in vc++? Pin
David Crow21-Oct-03 16:51
David Crow21-Oct-03 16:51 
Generalthanks Pin
Habbit21-Oct-03 16:55
Habbit21-Oct-03 16:55 
GeneralRe: how can i reach the same result in vc++? Pin
includeh1022-Oct-03 4:49
includeh1022-Oct-03 4:49 
GeneralRe: how can i reach the same result in vc++? Pin
David Crow22-Oct-03 5:10
David Crow22-Oct-03 5:10 
GeneralDisable Auto Bitmap Scroll in CScrollView Pin
Swinefeaster21-Oct-03 15:45
Swinefeaster21-Oct-03 15:45 
GeneralRe: Disable Auto Bitmap Scroll in CScrollView Pin
John R. Shaw22-Oct-03 3:53
John R. Shaw22-Oct-03 3:53 
The behavior you are describing is what CScrollView was designed to do.
Why would you want to disable this behavior?

May be the following will help you figure out what the problem is:

When you click the scrollbar in a CSrollView based window it is scrolled automaticaly for you and DC origin is changed to the new possition. You then receive a WM_PAINT message (OnDraw()) to update (draw) the invalid portion of the window.

Before scroll:

origin of DC and Window -> (0,0) +-------------------+
                                 |                   |
                                 |                   |
                                 |                   |
                                 |                   |
                        (0, 100) +-------------------+

After scroll:
           origin of DC -> (0,-N) +-------------------+
                                  |                   |
       origin of window -> (0, 0) +-------------------+ <- DC (0, N)
                                  |                   |
                                  |                   |
                   DC -> (0, 100) |-------------------|
                                  | Invalid rect.     | <- needs redrawing
               window -> (0, 100) +-------------------+ <- DC (0, 100 + N)


If you do any drawing to the window outside of OnDraw() then you will need get the origin of the drawing DC so that you know where to draw. I usualy just use the scroll positions:
Origin.x = -GetScrollPos(SB_HORZ);
Origin.y = -GetScrollPos(SB_VERT);

Smile | :) I hope this helps!

INTP
GeneralRe: Disable Auto Bitmap Scroll in CScrollView Pin
Swinefeaster22-Oct-03 7:15
Swinefeaster22-Oct-03 7:15 

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.