Re: Textbox select all content when tabbed

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Herfried K. Wagner [MVP] (hirf-spam-me-here_at_gmx.at)
Date: 05/03/04


Date: 03 May 2004 18:39:40 +0200


* "CT" <carstent@spammersgoawaydotnetservices.biz> scripsit:
> Try entering and deleting the text in a text box and tab to and from it,
> then it won't auto-select the entire text.

Thank you for making me aware of that. This will occur if you changed
the text of the textbox.

Solution: Add a handler to the textbox's 'GocFocus' event (you will
have to create this handler yourself because it's not listed in the
list of available events) and enter this code:

\\\
DirectCast(sender, TextBox).SelectAll()
///

-- 
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Relevant Pages

  • Re: Get name of control at a certain mousedown point
    ... you talk about the handler event in the tab page or tab control. ... do not know what labels or textboxes will be drawn on the tabpage, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Changing Character Entered
    ... and the form previews them before passing them on the handler for the ... > is there anything I can put in a Keypress handler that if the user pressed ... > the key it make it appear to the program that <Tab> was pressed? ... > there's a bunch of these text boxes this code has to be copied into then ...
    (microsoft.public.dotnet.languages.vb)
  • Keyboard messages in browser control on ATL dialog -- Urgent help
    ... I am hosting web browser control on an ATL dialog box. ... When I load a web form in the browser instance, the TAB ... handler is not invoked. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • CreateDirectory/Delete permission
    ... In the Session_Start handler of my intranet application, ... I later turned on Impersonation and that allowed ASPNET ... But I'm still having a problem with deleting the ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: pass CString?
    ... responsible for deleting the data when it is done (I.E., ... Alternatively you could use SendMessage and wait for the handler to finish ... >> I want to pass an array of UINT to another window through postmessage. ...
    (microsoft.public.vc.mfc)