Click here to Skip to main content
15,908,166 members
Home / Discussions / C#
   

C#

 
GeneralRe: backward compatibility Pin
Heath Stewart6-Jul-04 4:42
protectorHeath Stewart6-Jul-04 4:42 
GeneralDebug and Trace Pin
sreejith ss nair5-Jul-04 23:33
sreejith ss nair5-Jul-04 23:33 
GeneralRe: Debug and Trace Pin
Heath Stewart6-Jul-04 4:37
protectorHeath Stewart6-Jul-04 4:37 
GeneralDebug and Trace Pin
sreejith ss nair5-Jul-04 23:32
sreejith ss nair5-Jul-04 23:32 
GeneralRe: Debug and Trace Pin
Colin Angus Mackay5-Jul-04 23:37
Colin Angus Mackay5-Jul-04 23:37 
GeneralRe: Debug and Trace Pin
sreejith ss nair5-Jul-04 23:44
sreejith ss nair5-Jul-04 23:44 
Generallocalized application Pin
sreejith ss nair5-Jul-04 23:24
sreejith ss nair5-Jul-04 23:24 
GeneralRe: localized application Pin
Colin Angus Mackay5-Jul-04 23:33
Colin Angus Mackay5-Jul-04 23:33 
GeneralRe: localized application Pin
sreejith ss nair5-Jul-04 23:34
sreejith ss nair5-Jul-04 23:34 
GeneralRe: localized application Pin
Colin Angus Mackay5-Jul-04 23:40
Colin Angus Mackay5-Jul-04 23:40 
GeneralRe: localized application Pin
sreejith ss nair5-Jul-04 23:47
sreejith ss nair5-Jul-04 23:47 
GeneralRe: localized application Pin
sreejith ss nair5-Jul-04 23:54
sreejith ss nair5-Jul-04 23:54 
GeneralRe: localized application Pin
Colin Angus Mackay6-Jul-04 0:12
Colin Angus Mackay6-Jul-04 0:12 
GeneralRe: localized application Pin
Colin Angus Mackay5-Jul-04 23:55
Colin Angus Mackay5-Jul-04 23:55 
GeneralRe: localized application Pin
sreejith ss nair6-Jul-04 0:10
sreejith ss nair6-Jul-04 0:10 
Generallisence Pin
sreejith ss nair5-Jul-04 23:14
sreejith ss nair5-Jul-04 23:14 
GeneralRe: lisence Pin
Heath Stewart6-Jul-04 5:20
protectorHeath Stewart6-Jul-04 5:20 
Generalbitmap constructor throws InvalidArgumentException Pin
Pain_Elemental5-Jul-04 22:45
Pain_Elemental5-Jul-04 22:45 
GeneralRe: bitmap constructor throws InvalidArgumentException Pin
Anonymous6-Jul-04 3:45
Anonymous6-Jul-04 3:45 
GeneralRe: bitmap constructor throws InvalidArgumentException Pin
Dave Kreskowiak6-Jul-04 5:50
mveDave Kreskowiak6-Jul-04 5:50 
QuestionHow to Hide ScrollBar of RichtextBox Pin
Jay Shankar5-Jul-04 22:30
Jay Shankar5-Jul-04 22:30 
AnswerRe: How to Hide ScrollBar of RichtextBox Pin
Stefan Troschuetz5-Jul-04 22:59
Stefan Troschuetz5-Jul-04 22:59 
GeneralRe: How to Hide ScrollBar of RichtextBox Pin
Jay Shankar5-Jul-04 23:30
Jay Shankar5-Jul-04 23:30 
GeneralRe: How to Hide ScrollBar of RichtextBox Pin
Heath Stewart6-Jul-04 5:45
protectorHeath Stewart6-Jul-04 5:45 
What does synchronization have to do with "How to Hide ScrollBar of RichtextBox", which is what your subject says? The first reply answered your subject.

You don't pass a Message to WndProc. The RichTextBox encapsulates the Rich Edit common control, which manages the scroll bars itself. You only need to P/Invoke SendMessage (or SetScrollPos, as you asked about before) and set the scroll position. This results in the scroll messages being sent and the scroll bars adjusted automatically, all something done by the Rich edit control.

The only reason to override WndProc is to handle the WM_HSCROLL (0x0114) and WM_VSCROLL (0x0115) messages. As documented in the Platform SDK, the high-order word is the actual position, where the low-order word is the scrolling request. You should read the documentation for these two messages (though they are alike) in the Platform SDK on MSDN[^].

What you then do is call the P/Invoke'd SendMessage (see pinvoke.net[^] if you need help with the signature) with the same message (WM_HSCROLL or WM_VSCROLL) and the same parameters. Do not call WndProc directly. SendMessage (or use PostMessage for asynchronous operations, which should work in most cases) does this.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: How to Hide ScrollBar of RichtextBox Pin
Jay Shankar6-Jul-04 18:04
Jay Shankar6-Jul-04 18:04 

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.