Results 1 to 6 of 6

Thread: Me.SelectAll is not working on Textfield

  1. #1
    Join Date
    Jun 2004
    Posts
    63

    Me.SelectAll is not working on Textfield

    I making project which is included into curriculum of my college studies. I have inserted me.selectall into the GotFocus event of the textfield. I have noticed that it is not working for me at all. The event is firing into the project but there is no functionality which I wanted to have in the project. Let me know if you are having any useful instruction to get the requirement of mine. I am waiting for the prompt replies of yours. Thanks a lot in advance.

  2. #2
    Join Date
    Apr 2009
    Posts
    569

    Re: Me.SelectAll is not working on Textfield

    Well I am having a particular solution which you should try to fix the matter of yours and see whether it is working or not. I am suggesting following code which you should copy and paste into the project and see whether it is working or not.
    Code:
      TextField1.SelStart  = 0
      TextField1.SelLength = len(TextField1.Text)
    So try the same and let me know whether there is any difference in the situation.

  3. #3
    Join Date
    May 2009
    Posts
    529

    Re: Me.SelectAll is not working on Textfield

    Let me know what was the outcome after using the above mentioned solution. If there is no changes in the situation than you might need to make use of Textarea and simply set Multiline option to False. Once you have done the same it will work as a Textfield. Now you should try and see whether the SelectAll is working or not. Also you can try with selStart and see whether you have resolved the matter.

  4. #4
    Join Date
    May 2009
    Posts
    543

    Re: Me.SelectAll is not working on Textfield

    I am aware of a work around which you should try over here to fix the matter and inform about the result. You need to set the keyboard by using Me.SelectAll in the event of the GotFocus. Also you will be able to select the text without making use of SelectAll. If you are wanted to focus by using mouse then use the below mentioned code.
    Code:
    TextField:
    Sub GotFocus()
    Me.SelectAll()
    End Sub
    Function MouseDown(X As Integer, Y As Integer) As Boolean
    Return True
    End Function
    Sub MouseUp(X As Integer, Y As Integer)
    Me.SetFocus()
    End Sub

  5. #5
    Join Date
    May 2009
    Posts
    511

    Re: Me.SelectAll is not working on Textfield

    To fix the matter you need to perform following thing.
    • You have to add a new class and simply set Super to the Textfield.
    • Also you have to add property fGotFocus As Boolean into the newly created class.
    • Now add following method into the code.

    Code:
    Sub GotFocus()
      If fGotFocus = False then
        fGotFocus = True
        Me.SelectAll()
      End If
    End Sub
    
    Sub LostFocus()
      fGotFocus = False
    End Sub
    
    Function MouseDown(X As Integer, Y As Integer) As Boolean
      If fGotFocus = False Then Return True
    End Function
    
    Sub MouseUp(X As Integer, Y As Integer)
      Me.SetFocus()
    End Sub

  6. #6
    Join Date
    May 2009
    Posts
    637

    Re: Me.SelectAll is not working on Textfield

    I don’t why all the users have such complicated solutions over here. you have to put the me.SelectAll into the Getfocus event of the mouse. This particular solution is working on Mac OSX. I have not used the above mentioned thing on the Windows based operating system however you should try the same and let me know whether it is working or not. I think you will be able to resolve the issue after using the solution which I have mentioned over here.

Similar Threads

  1. Nokia 5800 Bug - Auto Rotation And Textfield
    By Uday64 in forum Software Development
    Replies: 4
    Last Post: 21-04-2010, 04:05 PM
  2. Nokia 5800 Bug - Auto rotation and textfield
    By Agriya in forum Portable Devices
    Replies: 4
    Last Post: 20-04-2010, 09:39 AM
  3. What is the use of TextField class?
    By Jaabili in forum Software Development
    Replies: 5
    Last Post: 06-03-2010, 08:15 PM
  4. Replies: 4
    Last Post: 26-07-2009, 12:37 AM
  5. Replies: 1
    Last Post: 03-07-2008, 09:32 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,039,778.90093 seconds with 16 queries