473,626 Members | 3,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object Focus

I have two TextBoxes so a user can enter a start and end date using a
calendar control. I am using the <Calendar1_Sele ctionChangedmet hod to input
the date in the textbox. My question is this: Is there a way to determine
which textbox has focus so when the the user clicks on a date in the calendar
control, the date selected is inputted into the textbox with focus? Below is
code that I am using.
private void Calendar1_Selec tionChanged(obj ect sender, System.EventArg s e)
{
if(txtStartDate .Text == "")
txtStartDate.Te xt = Calendar1.Selec tedDate.ToShort DateString();

else
txtEndDate.Text = Calendar1.Selec tedDate.ToShort DateString();
}

Jul 6 '06 #1
1 1082
in javascript, you could use the onblur event to figure out which
textbox they were in last.
Joseph wrote:
I have two TextBoxes so a user can enter a start and end date using a
calendar control. I am using the <Calendar1_Sele ctionChangedmet hod to input
the date in the textbox. My question is this: Is there a way to determine
which textbox has focus so when the the user clicks on a date in the calendar
control, the date selected is inputted into the textbox with focus? Below is
code that I am using.
private void Calendar1_Selec tionChanged(obj ect sender, System.EventArg s e)
{
if(txtStartDate .Text == "")
txtStartDate.Te xt = Calendar1.Selec tedDate.ToShort DateString();

else
txtEndDate.Text = Calendar1.Selec tedDate.ToShort DateString();
}
Jul 6 '06 #2

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

Similar topics

2
2800
by: Wai Man Chung | last post by:
Dear all, I have an asp page which upon opening a field will be set to be in focus so that user can type in data without the need to use the mouse to click on the field. However, after I add an applet object, the field cannot be in focus, even though there is statement in the asp page explicitly setting the field to be in focus. User has to wait for a short time (about 5 seconds). After the time,
2
7729
by: Paul Thompson | last post by:
I am trying to use various javascript tools, all of which work in NN, to work in IE. Here's my latest annoyance. I get a list of all objects on a page using docContents = document.getElementsByTagName("*"); for (var i=0; i < docContents.length; i++) { if (docContents.type == 'text' ||
1
2278
by: TAM | last post by:
Hi, I have a simple JavaScript code that ensures that all the form fields are filled and there is also a function that checks if the email is a valid address. For some reason IE is giving "Object Expected" error on the alert statement. The same code doesn't give an error in NN or Opera or Mozilla or FireFox. Can someone give me a clue as what could be wrong here?
3
2259
by: Gidi | last post by:
Hi, Is it possible to know when TextBox loses focus to which object it lost it? what i mean is when the LostFocus Event occur is it possible to know which object got the focus instead? thanks,
0
1733
by: Patrick | last post by:
This is a C# post. I'm using VB.NET to create an add-in for the Google Sidebar, and have implemented the OnDetailsView method. NOTE : I've come across this same problem (error message) even in C#. I tried placing a label control and setting the reference of this new lable into the 'details_control' parameter. This worked.
8
1408
by: psema4 | last post by:
Hi all, I've spent several days trying to work this out. Maybe I'm just searching for the wrong keywords/phrases. I have some code that looks like: Console = new Object(); Console.init = function() {
0
1340
by: Specterman | last post by:
Colin, thank you for your posts on this subject. It helped me to solve a similar problem I was having. I'm designing a form that will let the user select an Excel file to embed. It appears that setting the focus IS the key to this problem, however, you have to make sure you set the ".enabled" property of the OLE object to True before setting the focus. I don't want my users to edit the source file, so I have the OLE object disabled and...
4
1322
by: tshad | last post by:
I have an object surrounded by <div visible=false runat="server"></div>. So it doesn't show on the page until I set visible=true. I need to set focus to the object on post back: if not IsPostBack then Dim temp as String = "document.forms.Password.focus()" myBody.Attributes.Add("onload",temp) end if
1
3048
by: finditajr | last post by:
Hello I'm having the following problem: My main webpage calls a function stored in a .js file that creates an HTML window to display a calendar. Whenever I click on a date in that calendar, the calendar should return to the main webpage, but it cannot find the home window again. I'm getting this error: Microsoft JScript runtime error: 'self.opener.document.idFormMain.txtPeriodOfOperationEff' is null or not an object I've...
275
12233
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
8696
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
8637
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...
0
8502
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
6119
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
5571
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
4090
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
4195
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1504
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.