473,671 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

user control - lost focus?

I'm trying to trap for an event in my user control so that I can
manage the state of the user interface.

The control is used to enter data into a database.

The control contains a tab control with one tab containing a grid
listing records, the other tabs are display/entry fields.

The problem is how I handle adding a new record. If the user starts to
enter a new record. I disable all buttons except for a cancel button
in the control itself, but I don't disable other buttons and controls
on the form outside of the control.

I'm thinking that I could trap for the controls lost focus event in
the form, but I'm getting erratic results. The event isn't raised when
I click on another control, and sometimes it is raised when I click
back on the user control, but not always.

While I'm trying to figure out what's going on, I thought I'd ask for
help here.

Thanks, Bren
Oct 27 '08 #1
1 4360
"BrenB" <Go**********@e besser.comwrote in message
news:48******** *************** ***********@p49 g2000hsd.google groups.com...
I'm trying to trap for an event in my user control so that I can
manage the state of the user interface.

The control is used to enter data into a database.

The control contains a tab control with one tab containing a grid
listing records, the other tabs are display/entry fields.

The problem is how I handle adding a new record. If the user starts to
enter a new record. I disable all buttons except for a cancel button
in the control itself, but I don't disable other buttons and controls
on the form outside of the control.

I'm thinking that I could trap for the controls lost focus event in
the form, but I'm getting erratic results. The event isn't raised when
I click on another control, and sometimes it is raised when I click
back on the user control, but not always.

While I'm trying to figure out what's going on, I thought I'd ask for
help here.

Thanks, Bren
How about the controls Validate event?
Oct 27 '08 #2

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

Similar topics

2
4619
by: Karuppasamy | last post by:
Hi I have created a User Control Containing a Panel and Rich Text Box. The Panel contains some other controls used for formatting the Text entered in the Rich Text Box. My Requirement is that The Panel has to be visible only when the User Control got Focus and the Panel should not be shown to user when the User Control lost its focus.
0
1486
by: Carlos Lozano | last post by:
Hello everybody, I Have a piece of code for a Pocket PC that has a disabled and hidden textbox control at startup. It is enabled and set visible programatically. The cursor is captured calling the focus method. The problem is: the focus is lost almost inmediately. I can't type in anything. See the code below.
2
2149
by: bill | last post by:
I have the following user control in my project simply for setting focus to a control: Public Class SetFocus Inherits System.Web.UI.UserControl
12
4887
by: CLEAR-RCIC | last post by:
Hi, I'm having problems setting focus to a textbox on a web user contol on an asp.net web page. The following script works on normal asp.net pages: <script language="javascript"> function cmdButton1_Clicked() { document.all('txtInput1').focus(); return false; }
0
1712
by: Nick | last post by:
I have a situation wherein i have a text box, that has abc() being executed whenever the lost focus event is triggered. However, there is an exceptional case where, if a button click causes the lost focus, I do not want abc() to be called. Is there a method by which one can find out which control is triggering the lost focus event? I have a keyboard shortcut for the click handle, and the lost focus handle does not get invoked if I use...
1
2410
by: avinashraj | last post by:
Hello, I work with a third party control that provides the ability to load within it Winforms controls and providing a multi document interface such as the one in the VS.Net IDE. I find that adding a handler to the user control's got and lost focus works when the user control does not have any other controls hosted on it.
1
2288
by: Israel | last post by:
The problem: I want to know, definitively when a slider loses focus after a user has started sliding and hasn't released the mouse yet. It appears that this is captured with the WM_ACTIVATEAPP message but this only goes to the form and I want it in the user control that maybe very much removed from the form's knowledge; i.e. the form may launch a 3rd party form that, upon a call back, decides to launch other form that has my user control...
1
2677
by: =?Utf-8?B?amFtZXNAbm9zcGFtLmNvbQ==?= | last post by:
When processing the OnGotFocus event, I need to know the window/control that lost the focus. Is there a way to determint this? With MFC, you could use OnSetFocus which passed you the window that lost the focus. It there something similar with a c# control.
3
7040
by: Simon | last post by:
Dear reader, On the event "Lost focus" I make the ComboBox invisible but the massage pops up "You can't hide a control that has the focus." But this code is written in the "Lost focus" event so the combobox has not longer the focus regarding this event.
0
8472
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8390
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
8909
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8667
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5690
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
4221
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...
0
4399
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1801
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.