Click here to Skip to main content
16,013,207 members
Home / Discussions / C#
   

C#

 
AnswerRe: Calling the default ctor from an overloaded ctor? Pin
Colin Angus Mackay19-Jun-04 4:41
Colin Angus Mackay19-Jun-04 4:41 
GeneralRe: Calling the default ctor from an overloaded ctor? Pin
Nick Parker19-Jun-04 4:47
protectorNick Parker19-Jun-04 4:47 
GeneralRe: Calling the default ctor from an overloaded ctor? Pin
Colin Angus Mackay19-Jun-04 5:07
Colin Angus Mackay19-Jun-04 5:07 
GeneralRe: Calling the default ctor from an overloaded ctor? Pin
Nick Parker19-Jun-04 5:37
protectorNick Parker19-Jun-04 5:37 
GeneralRe: Calling the default ctor from an overloaded ctor? Pin
matthias s.19-Jun-04 5:10
matthias s.19-Jun-04 5:10 
GeneralRe: Calling the default ctor from an overloaded ctor? Pin
Heath Stewart19-Jun-04 7:19
protectorHeath Stewart19-Jun-04 7:19 
GeneralTwo RTF Questions Pin
XanderSon19-Jun-04 3:18
XanderSon19-Jun-04 3:18 
GeneralRe: Two RTF Questions Pin
Heath Stewart19-Jun-04 7:14
protectorHeath Stewart19-Jun-04 7:14 
You might want to mention in which event your checking for the return key. This should actually be processed in the control's ProcessDialogKey method - which fires before the rich textbox recieves it. This means you have to extend the RichTextBox class and override that method. Don't forget to read the documentation about it, however, instead of just using it. There's things you need to understand about it, including when you override a control method you typically call it on the base class at some point (especially if it's not a message, character, whatever that you want to handle - the base class may need to process it).

As far as scrolling to the bottom, this is actually quite easy but you need to P/Invoke SendMessage and SetScrollPos, which are documented in MSDN[^]. You first send WM_VSCROLL (0x0115) using SendMessage to the other RichTextBox, using it's Handle property (the HWND for that window), along with the scroll information as defined in the WM_VSCROLL documentation. You may also need to call SetScrollPos to set the scroll position for the RichTextBox.

One final approach is to use ScrollToCaret, a public method defined by TextBoxBase (the base class for TextBox and RichTextBox). Several people have had problems getting this to work and have had to use the approach above; as such, this has been covered here in the forums in the past, so if you'd like to read more about these threads, click "Search comments" immediately above the message board and try searching (I recommend using the keyword "WM_VSCROLL").

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Two RTF Questions Pin
XanderSon19-Jun-04 13:51
XanderSon19-Jun-04 13:51 
QuestionHow to use MFC dll in C#? Pin
ting66819-Jun-04 3:14
ting66819-Jun-04 3:14 
AnswerRe: How to use MFC dll in C#? Pin
Heath Stewart19-Jun-04 6:43
protectorHeath Stewart19-Jun-04 6:43 
GeneralRe: How to use MFC dll in C#? Pin
ting66820-Jun-04 2:00
ting66820-Jun-04 2:00 
GeneralRe: How to use MFC dll in C#? Pin
Heath Stewart20-Jun-04 11:54
protectorHeath Stewart20-Jun-04 11:54 
GeneralRe: How to use MFC dll in C#? Pin
ting66820-Jun-04 15:45
ting66820-Jun-04 15:45 
GeneralRe: How to use MFC dll in C#? Pin
Heath Stewart20-Jun-04 17:48
protectorHeath Stewart20-Jun-04 17:48 
GeneralRe: How to use MFC dll in C#? Pin
Heath Stewart20-Jun-04 11:54
protectorHeath Stewart20-Jun-04 11:54 
GeneralRe: How to use MFC dll in C#? Pin
ting66820-Jun-04 21:32
ting66820-Jun-04 21:32 
GeneralRe: How to use MFC dll in C#? Pin
Heath Stewart21-Jun-04 2:08
protectorHeath Stewart21-Jun-04 2:08 
GeneralRe: How to use MFC dll in C#? Pin
ting66821-Jun-04 3:08
ting66821-Jun-04 3:08 
GeneralRe: How to use MFC dll in C#? Pin
Heath Stewart21-Jun-04 3:13
protectorHeath Stewart21-Jun-04 3:13 
GeneralDrive Share account Pin
Guinness4Strength19-Jun-04 2:49
Guinness4Strength19-Jun-04 2:49 
GeneralRe: Drive Share account Pin
Heath Stewart19-Jun-04 7:03
protectorHeath Stewart19-Jun-04 7:03 
GeneralRe: Drive Share account Pin
Guinness4Strength19-Jun-04 11:15
Guinness4Strength19-Jun-04 11:15 
GeneralRe: Drive Share account Pin
Heath Stewart20-Jun-04 9:50
protectorHeath Stewart20-Jun-04 9:50 
GeneralRe: Drive Share account Pin
Guinness4Strength21-Jun-04 5:22
Guinness4Strength21-Jun-04 5:22 

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.