Mel
--
John Wood
EMail: first name, dot, second name at priorganize.com
"Mel Weaver" <Mel@[remove spam]insdirect.com> wrote in message
news:%234MA%23KTWE...@tk2msftngp13.phx.gbl...
this.textBox1.SelectionStart = textBox1.Text.Length;
this.textBox1.ScrollToCaret();
Shak.
"Mel Weaver" <Mel@[remove spam]insdirect.com> wrote in message
news:#4MA#KTWEH...@tk2msftngp13.phx.gbl...
You can use the previously posted responses if you don't mind the caret
position being moved. If you do not want to change the caret position, then
you will have to send the WM_VSCROLL message to the textbox, like so:
private const int WM_VSCROLL = 0x115;
private const int SB_BOTTOM = 7;
[DllImport("user32.dll", CharSet=CharSet.Auto)]
private static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam,
IntPtr lParam);
// Scroll to the bottom, but don't move the caret position.
SendMessage(textBox1.Handle, WM_VSCROLL, (IntPtr) SB_BOTTOM, IntPtr.Zero);
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"Mel Weaver" <Mel@[remove spam]insdirect.com> wrote in message
news:%234MA%23KTWE...@tk2msftngp13.phx.gbl...
do you know how to disable the context menu of displayed vertical and
horizontal scroll bar in the textbox?. How to insert my own menu there
overiding scrollbar menu?
Shak.
"Nicholas Paldino [.NET/C# MVP]" <m...@spam.guard.caspershouse.com> wrote in
message news:uXBWfXT...@TK2MSFTNGP11.phx.gbl...
I think that it can be done, but it would take a LOT of work. I was
able to get the menu to not come up, but unfortunately, it messed with how
the cursor was displayed, as well as the scrolling.
What it involves is intercepting the WM_NCHITTEST message. This is sent
to the control to query what elements are where. If the result indicated
that the hittest was for the vertical scrollbar, then I changed it to
indicate that it was part of the client. This caused the context menu to
pop up, but not much else.
I imagine it is possible by installing hooks for the current thread. It
would involve determining when the WM_NCHITTEST message is sent. Once you
do that, you would have to have the mouse event hook cancel out the sending
of the event to the textbox, if it was determined that the menu was going to
be shown.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"Shakir Hussain" <sh...@fakedomain.com> wrote in message
news:usFT4sTW...@TK2MSFTNGP10.phx.gbl...
Shak.
"Nicholas Paldino [.NET/C# MVP]" <m...@spam.guard.caspershouse.com> wrote in
message news:eb4gmRVW...@TK2MSFTNGP09.phx.gbl...
Quickly noticed that the scrollbar of the preview window of outlook express
shows the custom context menu.
Shak.
"Shakir Hussain" <sh...@fakedomain.com> wrote in message
news:usFT4sTW...@TK2MSFTNGP10.phx.gbl...