473,395 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1005

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

Similar topics

3
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...
1
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...
2
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...
2
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...
1
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(); ...
2
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...
1
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
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...
1
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! ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...

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.