mirror of https://github.com/quasar/Quasar.git
Merge pull request #368 from d3agle/master
RemoteShell caret positioning fix
This commit is contained in:
commit
4927d1b230
|
@ -8,6 +8,9 @@ namespace xServer.Core.Helper
|
|||
private const int LVM_FIRST = 0x1000;
|
||||
private const int LVM_SETITEMSTATE = LVM_FIRST + 43;
|
||||
|
||||
private const int WM_VSCROLL = 277;
|
||||
private const int SB_PAGEBOTTOM = 7;
|
||||
|
||||
public static int MakeLong(int wLow, int wHigh)
|
||||
{
|
||||
int low = (int)IntLoWord(wLow);
|
||||
|
@ -31,5 +34,10 @@ namespace xServer.Core.Helper
|
|||
};
|
||||
NativeMethods.SendMessageLVItem(handle, LVM_SETITEMSTATE, itemIndex, ref lvItem);
|
||||
}
|
||||
|
||||
public static void ScrollToBottom(IntPtr handle)
|
||||
{
|
||||
NativeMethods.SendMessage(handle, WM_VSCROLL, SB_PAGEBOTTOM, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,8 +43,7 @@ namespace xServer.Forms
|
|||
|
||||
private void txtConsoleOutput_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
txtConsoleOutput.SelectionStart = txtConsoleOutput.TextLength;
|
||||
txtConsoleOutput.ScrollToCaret();
|
||||
NativeMethodsHelper.ScrollToBottom(txtConsoleOutput.Handle);
|
||||
}
|
||||
|
||||
private void txtConsoleInput_KeyDown(object sender, KeyEventArgs e)
|
||||
|
@ -101,6 +100,7 @@ namespace xServer.Forms
|
|||
{
|
||||
txtConsoleOutput.Invoke((MethodInvoker)delegate
|
||||
{
|
||||
txtConsoleOutput.SelectionColor = Color.WhiteSmoke;
|
||||
txtConsoleOutput.AppendText(message);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue