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

passing values from one child form to another; input validation

In my MDI, I have a child form (frm_emp) that on a button click, displays
another child form w/ a listview (frm_list). I had two questions:

1) Assuming I already have the emplcode the user clicked on frm_list, how
would I be able to transfer that value back to frm_emp?
2) From within the double-clicked event in the frm_list, can I send the
emplcode value to frm_emp *and* execute a public method in frm_emp. It'd be
basically something like this (I know this code doesn't compile):
public String _myEmplcode = "";
private void btn_accept_Click(object sender, System.EventArgs e)
//clicked event in frm_list
{
frm_emp.empcode.Text = _myEmplcode; contains valid emplcode
frm_emp.RunThisMethod(); //RunThisMethod is public
this.Dispose(); //I'm done with the frm_list so I dispose.
}

I was also thinking if it's possible to validate the input in frm_emp.Text.
On the TextChanged property of the textbox, can I check to see where the
input came from and run a method according to the result? I'd be asking: if
the textbox input came from the value the listView returned, execute X
method. Otherwise (eg. the user entered a manual emplcode), do nothing.

Thank you.
Nov 15 '05 #1
3 1872
There's a lot of ways you can do this. One is to pass a refference to your
current frm_emp when you create and show your frm_list. Then just use that
reference to do whatever you want.

-JG
Nov 15 '05 #2
Thanks for the info.
And how would I be able to validate how the textbox got filled?
As soon as the textbox's filled with the emplcode that the user
double-clicked in the listbox , I'd like to be able to execute several
methods that would *not* be called if the user enters the emplcode by hand.
Is there some way that I can check how the textbox got filled? Someone
suggested validation events but I don't know how to call them.

Thanks again.

"Juan Gabriel Del Cid" <jd*****@atrevido.nospam.net> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
There's a lot of ways you can do this. One is to pass a refference to your
current frm_emp when you create and show your frm_list. Then just use that
reference to do whatever you want.

-JG

Nov 15 '05 #3
> Someone suggested validation events but I don't
know how to call them.


In this case, your validation event handler should call your validation
method:

// validate event handler
public void theTextBox_validate(...) {
this.checkTheTextBox(...);
}

public void checkTheTextBox(...) {
// actually do the checking
}

and then you just call the later method whenever you want to.

Hope that helps,
-JG
Nov 15 '05 #4

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

Similar topics

5
by: TG | last post by:
Conditions: Register globals is set to on. Parse html as php is set to on. I have two forms OrderTest1 and OrderTest2 and need to be able to validate the data from OrderTest1 before passing to...
1
by: Joe | last post by:
I am trying to write a Perlscript to be used with some HTML pages. Here is how it works: 1.. The first HTML page has a form which requests for user input. Then it passes the QUERY_STRING...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
1
by: Paul D. Fox | last post by:
I'm trying to launch a Child Window from a hyperlink on a Datagrid and have it recieve multiple values from the Parent Window. Upon recieving the values in the Child Window, I need to access them...
1
by: Jerim79 | last post by:
I have a simple 3 page registration form. One form, one "data validation" script and one "insert into database" script. The customer bounces back and forth from the form to the verification script...
5
by: Bubba | last post by:
I have a dynamic pulldown list (ASP with javascript) that when a user picks a state, the corresponding counties for that state appear in a dynamic second pulldown list. When I submit the form, the...
1
by: Renjini Mary | last post by:
hi... i cant seem to get value of set of radio buttons thru javscripting.. i hv set values to the radiobuttons but cannot retrieve them or calculate them in JS although it looks simple. do i need to...
3
by: DaveTWS | last post by:
I am making the switch from C++ to C#, and struggling as I cannot use pointers! I have a form (A) into which the user types some data. Depending upon the data entered Form A may then call another...
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?
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
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,...
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
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...
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.