|
-
Aug 17th, 2005, 01:48 PM
#1
Thread Starter
Hyperactive Member
remove focus away from textbox
After I change the text on textbox and hit ENTER, i want to save the changes and remove the focus away from the text box. How to do the remove? Thanks
-
Aug 17th, 2005, 02:14 PM
#2
Re: remove focus away from textbox
And what about setting the focus to another control ?
MyControl.Focus
-
Aug 17th, 2005, 02:19 PM
#3
Thread Starter
Hyperactive Member
Re: remove focus away from textbox
Yes, that can do the work. I just thought the textbox itself could do something.
-
Aug 17th, 2005, 02:23 PM
#4
Re: remove focus away from textbox
You can make the textbox non-focusable if you dont want it to draw the focus cue around it. Just in case to give you more options.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 17th, 2005, 02:24 PM
#5
Re: remove focus away from textbox
The focus have be somewhere after all !!!
Zak
-
Aug 17th, 2005, 02:26 PM
#6
Re: remove focus away from textbox
In the keydown event of the textbox you could do
VB Code:
If e.KeyCode = 13 then
TextBox2.Focus
End if
That would set the textbox to focus when you hit enter
-
Aug 17th, 2005, 02:29 PM
#7
Re: remove focus away from textbox
 Originally Posted by Zakary
The focus have be somewhere after all !!!
Zak
Not necessarily. You can inherit the textbox in a class and override the ShowFocusCues property and set the .TabStop = False. It will be "focussed" but there will be no visual indication of being focussed.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 17th, 2005, 02:36 PM
#8
Re: remove focus away from textbox
-
Aug 17th, 2005, 02:42 PM
#9
Re: remove focus away from textbox
I must confess, I learned it from klienma using a LinkLabel control when I was in the beginning stages of building my Panel control. Simulating the XP Explorer panel on the left side. The labels do not ever get focussed and he showed me how.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|