-
- VBForums
- Visual Basic
- Visual Basic .NET
- is information technology possible to check if a certain control Has Focus???
-
Mar 18th, 2005,03:54 PM #1 Thread Starter Frenzied Member is it possible to check if a certain command Has Focus??? hi all is it possible to cheque that a certain command has the focus crusade i desire to practice something and then return back to the command the user was focusing on. is it possible, and as well is it possible to become the control that is already having the focus on the form???? thx in advance RGDS -
Mar 18th, 2005,03:57 PM #2 New Fellow member Re: is information technology possible to check if a certain control Has Focus??? Yes information technology is. Anything is possible. Side by side time enquire how to exercise it. -
Mar 18th, 2005,04:00 PM #iii Thread Starter Frenzied Fellow member Re: is it possible to check if a certain control Has Focus??? ok How??? -
Mar 18th, 2005,04:02 PM #4 New Fellow member Re: is it possible to check if a certain control Has Focus??? -
Mar 18th, 2005,04:05 PM #5 Thread Starter Frenzied Member Re: is it possible to cheque if a certain command Has Focus??? -
Mar 18th, 2005,04:07 PM #6 New Member Re: is it possible to check if a sure control Has Focus??? Rotflmao Private Sub btnAdd_GotFocus(ByVal sender As Object, ByVal e As Organization.EventArgs) Handles btnAdd.GotFocus End Sub Hmm you sure you using vb.cyberspace? -
Mar 18th, 2005,04:14 PM #7 Thread Starter Frenzied Member Re: is it possible to bank check if a certain control Has Focus??? are u sure u sympathize oop programming what you lot brash me is an event handler , when i demand to cheque something i can't make if statement to check the event handler. i was asking if there is a property or method that could be checked to know if the control has focus. and i affair the code you lot have posted is Incorrect there is no event called gotfocus. whatsoever windows control triggers the ENTER issue when getting the user focus tin y'all sympathize what i mean ??? -
Mar 18th, 2005,04:21 PM #8 Re: is it possible to cheque if a certain control Has Focus??? VB Code: -
If Button1.Focused = True And then -
MessageBox.Bear witness("Button1 was focused until I showed this msgbox!") -
Terminate If VB/Office Guru� (AKA: Gangsta Yoda� � ) I dont answer coding questions via PM. Delight mail service a thread in the appropriate forum. Microsoft MVP 2006-2011 Part Evolution FAQ (C#, VB.NET, VB 6, VBA) Senior Jedi Software Engineer MCP (VB 6 & .Cyberspace), BSEE, CET If a mail service has helped you then Please Rate information technology! � Reps & Rating Posts � VS.Net on Vista � Multiple .NET Framework Versions � Office Primary Interop Assemblies � VB/Role Guru� Give-and-take SpellChecker�.NET � VB/Part Guru� Give-and-take SpellChecker� VB6 � VB.NET Attributes Ex. � Outlook Global Address Listing � API Viewer utility � .NET API Viewer Utility � System: Intel i7 6850K, Geforce GTX1060, Samsung M.ii 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Function 2016, VS 2019, VB6 SP6 -
Mar 18th, 2005,04:22 PM #9 New Fellow member Re: is it possible to check if a certain control Has Focus??? Originally Posted by maged hi all is information technology possible to cheque that a certain control has the focus cause i want to do something and and then return dorsum to the control the user was focusing on. is it possible, and too is it possible to get the control that is already having the focus on the form???? thx in advance RGDS 1. Yes I understand oop Your question was: is it possible to cheque that a sure command has the focus This is an result. the code you have posted is Wrong I copied and pasted the code from my ide. If that is not what you want then you actually need to make yourself more clear. -
Mar 18th, 2005,04:24 PM #10 Thread Starter Frenzied Member Re: is it possible to check if a certain command Has Focus??? Oh people , become serious . there is nothing called FOCUSED in Vb.net what are you talking about. -
Mar 18th, 2005,04:25 PM #eleven Thread Starter Frenzied Fellow member Re: is it possible to check if a certain control Has Focus??? ok lets be clear i want to ask the class who is having focus within you lot i need to know the command who accept focus on class 1 is that Clear enought ??? -
Mar 18th, 2005,04:26 PM #12 Re: is information technology possible to check if a certain control Has Focus??? THAT is what the .Focused is for! Originally Posted by MSDN .NET Framework Course Library Control.Focused PropertySee Also Control Course | Control Members | Organisation.Windows.Forms Namespace | CanFocus | Focus | CanSelect | ContainsFocus | Control Members (Visual J# Syntax) | Managed Extensions for C++ Programming Requirements Platforms: Windows 98, Windows NT iv.0, Windows Millennium Edition, Windows 2000, Windows XP Dwelling Edition, Windows XP Professional, Windows Server 2003 family, .Net Compact Framework - Windows CE .NET Language C# C++ JScript Visual Basic Testify All Gets a value indicating whether the control has input focus. [Visual Basic] Public Overridable ReadOnly Property Focused As Boolean [C#] public virtual bool Focused {get;} [C++] public: __property virtual bool get_Focused(); [JScript] public office get Focused() : Boolean; Property Value truthful if the control has focus; otherwise, fake. Remarks Notes to Inheritors: When overriding the Focused holding in a derived class, use the base form'due south Focused property to extend the base implementation. Otherwise, yous must provide all the implementation. Example [Visual Basic, C#, C++] The following example disables a MenuItem if a TextBox does not have focus. This example assumes you have a Form with a TextBox named textBox1 and two MenuItem objects named menuItemEdit and menuItemEditInsertCustomerInfo. [Visual Basic] Private Sub menuItemEdit_Popup(sender As Object, _ e Equally EventArgs) Handles menuItemEdit.Popup ' Disable the menu item if the text box does non have focus. Me.menuItemEditInsertCustomerInfo.Enabled = Me.textBox1.Focused Terminate Sub [C#] private void menuItemEdit_Popup(object sender, EventArgs e) { // Disable the menu item if the text box does not take focus. this.menuItemEditInsertCustomerInfo.Enabled = this.textBox1.Focused; } [C++] private: void menuItemEdit_Popup(Object* /*sender*/, EventArgs* /*east*/) { // Disable the bill of fare item if the text box does not have focus. this->menuItemEditInsertCustomerInfo->Enabled = this->textBox1->Focused; } [JScript] No example is available for JScript. To view a Visual Bones, C#, or C++ example, click the Language Filter button in the upper-left corner of the page. Requirements Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Habitation Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework - Windows CE .NET Encounter As well Control Form | Control Members | System.Windows.Forms Namespace | CanFocus | Focus | CanSelect | ContainsFocus | Control Members (Visual J# Syntax) | Managed Extensions for C++ Programming Syntax based on .Internet Framework version 1.1. Documentation version 1.1.0. -------------------------------------------------------------------------------- Send comments on this topic. � 2001-2002 Microsoft Corporation. All rights reserved. VB/Office Guru� (AKA: Gangsta Yoda� � ) I dont answer coding questions via PM. Please mail service a thread in the advisable forum. Microsoft MVP 2006-2011 Office Development FAQ (C#, VB.NET, VB half-dozen, VBA) Senior Jedi Software Engineer MCP (VB 6 & .Internet), BSEE, CET If a mail has helped y'all then Delight Rate information technology! � Reps & Rating Posts � VS.NET on Vista � Multiple .Net Framework Versions � Part Main Interop Assemblies � VB/Office Guru� Word SpellChecker�.Net � VB/Role 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 K.two one TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 -
Mar 18th, 2005,04:37 PM #xiii Thread Starter Frenzied Member Re: is it possible to check if a certain control Has Focus??? RobDog888 YOU ARE RIGHT AND I WAS WRONG there is something going incorrect with my IDE intellisense, it doesen't show the focused property but when i typed it completely it worked and it is boolean. well RobDog888 i was wrong again and i am sorry for the disturbance c u rgds -
Mar 18th, 2005,04:xl PM #fourteen Re: is it possible to check if a certain command Has Focus??? No prob. Y'all probably deceit come across it in the intellisense because yous may take your ide settings to hibernate advanced members (default). Uncheck it and you will have all the intellisense y'all want. VB/Part Guru� (AKA: Gangsta Yoda� � ) I dont answer coding questions via PM. Please post a thread in the appropriate forum. Microsoft MVP 2006-2011 Function Development FAQ (C#, VB.Internet, VB half-dozen, 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.Cyberspace on Vista � Multiple .Net Framework Versions � Role Primary Interop Assemblies � VB/Role Guru� Word SpellChecker�.Net � VB/Office Guru� Word SpellChecker� VB6 � VB.NET Attributes Ex. � Outlook Global Accost List � API Viewer utility � .Internet 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, Function 2016, VS 2019, VB6 SP6 -
Mar 18th, 2005,04:44 PM #15 Thread Starter Frenzied Member Re: is information technology possible to cheque if a certain control Has Focus??? well Strange, what is avant-garde most FOCUSED Property !!!! i dont know but sometimes microsoft categorizes things in a very strange gild. but thank you for everything -
Mar 18th, 2005,04:50 PM #xvi Re: is it possible to check if a sure control Has Focus??? Dont know, but its in the tips sticky at the tiptop of the vb.internet forum for detailed instructions on how to show all. I take know thought why you would always want to limit a developer from using all the tools. VB/Office Guru� (AKA: Gangsta Yoda� � ) I dont respond coding questions via PM. Please post a thread in the appropriate forum. Microsoft MVP 2006-2011 Office Evolution FAQ (C#, VB.Cyberspace, VB half-dozen, VBA) Senior Jedi Software Engineer MCP (VB vi & .Net), BSEE, CET If a postal service has helped y'all 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� Discussion SpellChecker� VB6 � VB.Cyberspace Attributes Ex. � Outlook Global Address List � API Viewer utility � .NET API Viewer Utility � System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 ane TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, ii Viewsonic 24" LCDs, Windows 10, Function 2016, VS 2019, VB6 SP6 -
Mar 18th, 2005,04:58 PM #17 Thread Starter Frenzied Fellow member Re: is information technology possible to check if a certain control Has Focus??? I have know idea why you would e'er want to limit a programmer from using all the tools. Hold -
- VBForums
- Visual Basic
- Visual Basic .Cyberspace
- is information technology possible to check if a certain command Has Focus???
Posting Permissions - Yous may non post new threads
- You may non post replies
- You may not post attachments
- You may not edit your posts
- BB lawmaking is On
- Smilies are On
- [IMG] code is On
- [VIDEO] code is On
- HTML lawmaking is Off
Forum Rules | Click Here to Expand Forum to Full Width |
Post a Comment for "vb how to tell what control has focus"