I have made code to store the cursors position within the textbox:
Expand|Select|Wrap|Line Numbers
- Option Compare Database
- Option Explicit
- Private lngCursorPosition
- Private lngCursorSelectionLength
- Private Sub tb_RibbonXml_BeforeUpdate(Cancel As Integer)
- 'Record cursor position
- lngCursorPosition = Me.tb_RibbonXml.SelStart
- lngCursorSelectionLength = Me.tb_RibbonXml.SelLength
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub Form_AfterUpdate()
- On Error Resume Next
- If Me.ID = lngRibbonID Then
- If Screen.ActiveControl = Me.tb_RibbonXml Then
- 'Restore cursor position
- Me.tb_RibbonXml.SelStart = lngCursorPosition
- Me.tb_RibbonXml.SelLength = lngCursorSelectionLength
- End If
- End If
- End Sub
Anyone have some good suggestions?
This link could be usefull, but I am really not that good with using the declare function to get a function from an API.