473,387 Members | 1,420 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,387 software developers and data experts.

Event that caused checkbox to fill?

I have a textbox in my Win form that can be filled when a user chooses an
emplcode from a combobox and when the value is returned from another form
(double-clicks on a separate listbox).
What event can I use to find out how the textbox got filled? In my case, if
the textbox is filled when the user double-clicked on a separate listbox,
I'd like to run VerifyEmp() method. If it's via the combobox or by hand, I
don't do anything.
Someone suggested validating/validation events but I have no idea how to use
them.

Thanks.
Nov 15 '05 #1
3 1760
Hi,

I don;t think that you can do this from the TextBox's point, all you can
see is that the text was changed (TextChanged event), no where the
TextBox.Text was set.

Now I can think of a possible solution:

Make the check in the handlers of the other controls when needed, in the
double click event of the listbox for example.
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Vaughn" <vo******@yahoo.com> wrote in message
news:O6**************@tk2msftngp13.phx.gbl...
I have a textbox in my Win form that can be filled when a user chooses an
emplcode from a combobox and when the value is returned from another form
(double-clicks on a separate listbox).
What event can I use to find out how the textbox got filled? In my case, if the textbox is filled when the user double-clicked on a separate listbox,
I'd like to run VerifyEmp() method. If it's via the combobox or by hand, I
don't do anything.
Someone suggested validating/validation events but I have no idea how to use them.

Thanks.

Nov 15 '05 #2
Thanks for your reply.
I didn't really understand what you meant with making the check in the
handlers of the other controls.
If I pass the whole form as reference, do I have access to all of its
controls? Or do I need to pass all the controls as reference?

Vaughn

PD - In the subject line, it's supposed to be "textbox", not "checkbox".
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:e4*************@TK2MSFTNGP11.phx.gbl...
Hi,

I don;t think that you can do this from the TextBox's point, all you can
see is that the text was changed (TextChanged event), no where the
TextBox.Text was set.

Now I can think of a possible solution:

Make the check in the handlers of the other controls when needed, in the
double click event of the listbox for example.
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Vaughn" <vo******@yahoo.com> wrote in message
news:O6**************@tk2msftngp13.phx.gbl...
I have a textbox in my Win form that can be filled when a user chooses an emplcode from a combobox and when the value is returned from another form (double-clicks on a separate listbox).
What event can I use to find out how the textbox got filled? In my case,

if
the textbox is filled when the user double-clicked on a separate listbox, I'd like to run VerifyEmp() method. If it's via the combobox or by hand, I don't do anything.
Someone suggested validating/validation events but I have no idea how to

use
them.

Thanks.


Nov 15 '05 #3
Hi Vaughn,

What I meant is that you inside the handler for the TextBox's TextChanged
event you cannot know what method provoked the event.
If you need to verify the value you have two path:
1- Always verify it, unless that your validation code is slow you should
always check it.
2- Put the checking responsability to the event that needs validation ont he
DoubleClick event of the ListBox.

Now you said this listbox was on another form , therefore for you to have
access to the original form's TextBox you could pass either the TextBox
instance of a reference to the whole form, if you do the latter you need to
define either the TextBox as public or implement a property that return it.

I would pass only the TextBox reference.
Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Vaughn" <vo******@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Thanks for your reply.
I didn't really understand what you meant with making the check in the
handlers of the other controls.
If I pass the whole form as reference, do I have access to all of its
controls? Or do I need to pass all the controls as reference?

Vaughn

PD - In the subject line, it's supposed to be "textbox", not "checkbox".
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:e4*************@TK2MSFTNGP11.phx.gbl...
Hi,

I don;t think that you can do this from the TextBox's point, all you can
see is that the text was changed (TextChanged event), no where the
TextBox.Text was set.

Now I can think of a possible solution:

Make the check in the handlers of the other controls when needed, in the double click event of the listbox for example.
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Vaughn" <vo******@yahoo.com> wrote in message
news:O6**************@tk2msftngp13.phx.gbl...
I have a textbox in my Win form that can be filled when a user chooses an emplcode from a combobox and when the value is returned from another form (double-clicks on a separate listbox).
What event can I use to find out how the textbox got filled? In my
case, if
the textbox is filled when the user double-clicked on a separate listbox, I'd like to run VerifyEmp() method. If it's via the combobox or by
hand,
I don't do anything.
Someone suggested validating/validation events but I have no idea how

to use
them.

Thanks.



Nov 15 '05 #4

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

Similar topics

4
by: Steph | last post by:
Hello, Can someone tell me the script to use for having a change on the same page when using checkbox function ? For example, i would to check one condition and display dynamically a button...
4
by: Richard W | last post by:
I am working on a new ASP.NET web application (with C# as the underlying language) using VisualStudio.NET 2003 Enterprise Architect. I am also pretty much a newbie at this stuff, having been a VFP...
5
by: Dan | last post by:
Hi, I'd like to find out the control that caused a postback to be raised. Obviously this could simply done in a control event handler. I am not going to do this method and would like no...
2
by: Steve Caliendo | last post by:
Hi, I am dynamically generating check boxes in the Panel control based on a database field, and I've set the AutoPostBack property to True. How can I determine which CheckBox caused the post...
10
by: william | last post by:
Hi, I have a datagrid, inside there is a templete item, it's button. I want to do some thing when user click the button, but do not want the postback event happens. How can I do it? Thanks. ...
2
by: info | last post by:
novice.... i started a php site in dreamweaver and i try fill data into MySql database. i set up a page with a form and i can fill in all the fields. just for one field, i like to have...
34
by: clinttoris | last post by:
Hello Experts, I have been told to post this in the Javascript forum as I want to do this client side just before my form gets submitted. Once the user clicks the submit button a javascript...
5
by: rn5a | last post by:
Consider the following user control which resides in Address.ascx: <script runat="server"> Public Property Address() As String Get Address = txtAddress.Text End Get Set(ByVal value As String)...
2
by: =?Utf-8?B?UmljaA==?= | last post by:
Is there a cancel argument for cancelling if you want to check or uncheck a checkbox? In the checkChanged event of a checkbox I ask the user if they are sure they want to check/uncheck...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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...

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.