Click here to Skip to main content
15,897,518 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: How to Hide ScrollBar of RichtextBox Pin
Heath Stewart7-Jul-04 3:29
protectorHeath Stewart7-Jul-04 3:29 
GeneralRe: How to Hide ScrollBar of RichtextBox Pin
Jay Shankar12-Jul-04 22:54
Jay Shankar12-Jul-04 22:54 
GeneralRe: How to Hide ScrollBar of RichtextBox Pin
Heath Stewart13-Jul-04 3:26
protectorHeath Stewart13-Jul-04 3:26 
GeneralRe: How to Hide ScrollBar of RichtextBox Pin
Jay Shankar21-Jul-04 18:27
Jay Shankar21-Jul-04 18:27 
GeneralC#, XML, XPath problem Pin
velincho5-Jul-04 22:23
velincho5-Jul-04 22:23 
GeneralRe: C#, XML, XPath problem Pin
leppie6-Jul-04 7:26
leppie6-Jul-04 7:26 
GeneralRe: C#, XML, XPath problem Pin
velincho6-Jul-04 22:23
velincho6-Jul-04 22:23 
QuestionHOW TO CREATE IMAGE FRAMES FROM METAFILES Pin
gayathri_gopi5-Jul-04 22:22
gayathri_gopi5-Jul-04 22:22 
GeneralDllImport Pin
Anonymous5-Jul-04 22:12
Anonymous5-Jul-04 22:12 
GeneralRe: DllImport Pin
Anonymous5-Jul-04 22:26
Anonymous5-Jul-04 22:26 
GeneralRe: DllImport Pin
Stefan Troschuetz5-Jul-04 22:43
Stefan Troschuetz5-Jul-04 22:43 
GeneralDirectX Pin
Anonymous6-Jul-04 3:16
Anonymous6-Jul-04 3:16 
GeneralRe: DirectX Pin
Stefan Troschuetz6-Jul-04 3:48
Stefan Troschuetz6-Jul-04 3:48 
QuestionIs it possible to edit a bitmap programmatically? Pin
Pain_Elemental5-Jul-04 21:14
Pain_Elemental5-Jul-04 21:14 
AnswerRe: Is it possible to edit a bitmap programmatically? Pin
Dave Kreskowiak6-Jul-04 5:17
mveDave Kreskowiak6-Jul-04 5:17 
GeneralRe: Is it possible to edit a bitmap programmatically? Pin
Pain_Elemental6-Jul-04 19:50
Pain_Elemental6-Jul-04 19:50 

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.