Click to See Complete Forum and Search --> : Positioning cursor in text box
kandan
Nov 23rd, 1999, 01:03 PM
hi,
Is there any way to get information of the client object fron an ActiveXDll component(Just like an Extender object in case of an activeX control.
kandan
E-mail: rg_kandan@usa.net
ICQ: 52774533
I can't seem to get the cursor back to the last position in the text box. Any ideas?
Here is part of the code of the text box TxtConCan.Text. The user enter a key word then presses a logical opertor button. As it stands now, the usr has to manually place the cursor at the end of the text line before he/she can enter another keyword.
thanks
Option Explicit
> ' Public Concanit As String
> ' Public pintCount As Integer
> ' Public pstrCountAnd As String
> ' Public pstrCountOr As String
> ' Public pstrCountExclude As String
>
> Private Sub btnand_Click()
> Me.TxtConCan.SetFocus
> Me.TxtConCan.Text = Me.TxtConCan.Text & " 'AND' "
> Me.btnand.SetFocus
> End Sub
>
> Private Sub btnandnot_Click()
> Me.TxtConCan.SetFocus
> Me.TxtConCan.Text = Me.TxtConCan.Text & " 'EXCLUDE' "
> Me.btnandnot.SetFocus
> End Sub
>
> Private Sub btnClose_Click()
> DoCmd.close acForm, "frmRetrieve"
> Forms![mainswitchboard].Visible = True
> End Sub
>
> Private Sub btnor_Click()
> Me.TxtConCan.SetFocus
> Me.TxtConCan.Text = Me.TxtConCan.Text & " 'OR' "
> Me.btnor.SetFocus
> End Sub
Mark Sreeves
Dec 6th, 1999, 02:25 PM
In sytead of resetting the focus back to the button you've just clicked do this:
TxtConCan.SelStart = Len(TxtConCan.Text)
eg:
Private Sub btnand_Click()
Me.TxtConCan.SetFocus
Me.TxtConCan.Text = Me.TxtConCan.Text & " 'AND' "
'Me.btnand.SetFocus
TxtConCan.SelStart = Len(TxtConCan.Text)
End Sub
Is this any help?
------------------
Mark Sreeves
Analyst Programmer
Mark.Sreeves@Softlab.co.uk
A BMW Group Company
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.