Question: I have a wxTextCtrl with many lines of text with scrollbars enabled. Inside an event, I'd like to scroll to the end of the control and redraw the control.

Here's what I have:

```
    def event_scroll_to_end(self, event):
        self.m_textCtrl1.SetScrollPos(
            wx.VERTICAL,
            self.m_textCtrl1.GetScrollRange(wx.VERTICAL))
        event.Skip()

```

This scrolls to the end and updates/redraws the scroll bar itself, but it doesn't update the textCtrl, which still shows scrolled to its current position.

How can I actually scroll the textCtrl as well so that the contents are scrolled to the end, as the scrollbar indicates?

Answer: 
The `ShowPosition` function can be used to scroll to the end by showing the last position of the buffer.

```
    def event_scroll_to_end(self, event):
        self.m_textCtrl3.ShowPosition(self.m_textCtrl3.GetLastPosition())
        event.Skip()

```
I have been struggling with this as well. 
In the end, the following worked for me:

```
    mywindow.SetInsertionPoint(-1)
    mywindow.ShowPosition(mywindow.GetLastPosition())
    mywindow.Refresh()
    mywindow.Update()

```