Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi !

I found this code example in the FAQ at top of this forum, but i got this problem.

Can anyone help me make it, so i can use it in VB.net?

 

Thanks allot.

 

    const int SB_VERT = 1; 

    const int EM_SETSCROLLPOS = 0x0400 + 222; 



    [DllImport("user32", CharSet=CharSet.Auto)] 

    public static extern bool GetScrollRange(IntPtr hWnd, int nBar, out int lpMinPos, out int lpMaxPos); 



    [DllImport("user32", CharSet=CharSet.Auto)] 

    public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, POINT lParam); 



    [structLayout(LayoutKind.Sequential)] 

    public class POINT 

    { 

         public int x; 

         public int y; 



         public POINT() 

         { 

         } 



         public POINT(int x, int y) 

         { 

              this.x = x; 

              this.y = y; 

         } 

    } 



    // Example -- scroll the RTB so the bottom of the text is always visible. 

    int min, max; 

    GetScrollRange(richTextBox1.Handle, SB_VERT, out min, out max); 

    SendMessage(richTextBox1.Handle, EM_SETSCROLLPOS, 0, new POINT(0, max - richTextBox1.Height)); 

Posted

Never mind i found another way around my problem.

 

Private Sub Console_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Console.TextChanged
Console.SelectionStart = Len(Console.Text)
Console.Focus()
InputLine.Focus()
End Sub

 

This will scroll the RTP to the end.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...