473,804 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't get the focus to the Parent control - Help!

Hello Gurus,

Using VS2005 with .NET Framework 2.0.

I wrote a GUI control A derived from UserConstrol, this control contains
another UserControl derived B which contains two Labels controls and two
NumericUpDown controls.

The trouble is:
After one of the NumericUpDown get the focus by mouse click on it, I can not
get the focus back to A.
I tried handling the A.MouseUp event to take the focus by Focus() (or by
Select()) but the focus stays at the NumericUpDown.
I tried CanFocus in thisA. MouseUp event handler and it returns true, still;
the following line of Focus() fails.

After the application starts, the focus is set correctly on the A control,
but I can get back the focus after the NumericUpDown has it.
How can I take the focus back to control A?
--
Thanks
Sharon
Sep 14 '08 #1
0 1023

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4860
by: Randell D. | last post by:
I have a parent window that calls window.open("myurl","mywindowname"); I would like to do the all (or some) of the following - can someone help? From the parent, close the child and... From the parent, focus the child... Anybody help me? Thanks,
1
1493
by: Joost | last post by:
Hi to all, I have a subform which changes its Sourceobject, using the following expression: Forms!!.SourceObject = "Subform Deposito Mant" and the focus to the desired control, a textbox calles "TxtMonto"
2
2670
by: Lyn | last post by:
Hi, I have a text control on a form which is bound to table field StartDate which is in Date format. When updating the table record via the form, any data entered into the StartDate control is immediately validated. If the data entered is considered valid, focus moves to the next control in the tab sequence. So far, so good. If the data entered in StartDate is considered invalid, an error message is displayed via MsgBox. When OK is...
2
8376
by: Tom | last post by:
I am developing a VB.NET user control that is composed of a component control (along with some classes, etc). This is probably a stupid question, and should be easy, but I must be having a brain fart. In the control itself, how do I set focus BACK to the form that the control is on? This control does some maniuplation of an outside application (by starting up the application and sending it keystrokes). What I want to be able to do is to...
1
1792
by: reidarT | last post by:
I have a webform and found some code where I understand some of it, but not all The code is as follows public static void SetFocus(Control control) { StringBuilder sb = new StringBuilder(); sb.Append("\r\n<script language='JavaScript'>\r\n"); sb.Append("<!--\r\n"); sb.Append("function SetFocus()\r\n");
2
1387
by: genojoe | last post by:
I have a form with an RTF control and I want to use a subform to do "Find and Replace". Beyond that, I want the subForm to always be on Top when the Parent form has focus but have it not be on top if neither the subform nor parent form have focus. The code that I think should do this is the following. Unfortunately, with this code, the subForm retains focus. (Me.Focus() is ignored) Is there a way to have the subform be on top but...
1
1601
by: prabuinet | last post by:
hi, I added a form as a control on another form. After adding i want the embedded form to have focus. I tried all combinations but its not working.. Do any one know how to do this. -------------------------------------------
7
8079
by: kiwipedia | last post by:
Hi all I have a combo-box control which I've set as a required field. It's a date and uses a calendar as coded below. All works fine unless the user deletes a pre-existing value (leaving a 0-length string I guess) and then clicks in the Insertion control. This results in Runtime error '2110' with the message that "can't move the focus to the control Calendar0" I think this is because I've made Insertion a required field - certainly the...
1
1821
by: giddy | last post by:
hi , I made a simple little caption control , i want to put it in a split container so it looks a litte like the VS windows. Problem is , i cant get it to the correct Inactive/Active colour! Apparently , the splitcontainerPanel ContainsFocus even after it has lost focus , atleast thats what you'd think after you run the code!
0
9576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10311
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9138
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5516
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4292
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2988
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.