473,513 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to pass parameter to second form?

I am invoking a second form and would like to pass a parameter. My code is:

Private Sub btnHelp_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnHelp.Click

Dim frmAdminHelp As New frmAdminHelp

frmAdminHelp.Show()

End Sub
When the second form executes, it needs to know where it was called from.
How do I do this?

TIA,

John
Nov 21 '05 #1
2 4576
* "John Howard" <jo*********@dcf.state.fl.us> scripsit:
I am invoking a second form and would like to pass a parameter. My code is:

Private Sub btnHelp_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnHelp.Click

Dim frmAdminHelp As New frmAdminHelp
Add a property to your 'frmAdminHelp' and set this property here.
frmAdminHelp.Show()


--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> escreveu na mensagem
news:2q************@uni-berlin.de...
* "John Howard" <jo*********@dcf.state.fl.us> scripsit:
I am invoking a second form and would like to pass a parameter. My code is:
Private Sub btnHelp_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnHelp.Click

Dim frmAdminHelp As New frmAdminHelp
Add a property to your 'frmAdminHelp' and set this property here.


And you could Override the Show() method in frmAdminHelp that calls the base
class Show() method and sets the property in one step, so you can do:

frmAdminHelp.Show(Me)

Me will be a reference to the calling form (the current form)
frmAdminHelp.Show()


--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

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

Similar topics

1
23469
by: Dion Heskett | last post by:
How can I pass a Class as a parameter to in a method ? i.e. Private myMethod( string pram1, Classobject as pram2) { Classobject.DataSource = reader; Classobject.DataBind(); }
3
2924
by: Mikey | last post by:
I'm really new at the c# scene and I think I've proabably jumped in the deep end :) I'm really interested in developing Windows Applications but most sources seem to deal with web development...
1
2293
by: Chandru | last post by:
hi Thanks, some of reply for my query. the actual problem is, I have two forms Form-A and Form-B. In Form-A i have two controls TextBox and Button, and in Form-B i have the same one textBox and...
4
146960
by: _Mario.lat | last post by:
Hallo, I have a little question: In the function session_set_save_handler I can pass the name of function which deal with session. In Xoops code I see the use of this function like that: ...
2
3334
by: bbsbob | last post by:
Hello, I'm still using the Framework v1.1. Forgive me, I'm working on a legacy application. I'm using 2 iFrame sections with 2 aspx pages, i.e. 1.aspx (left) and 2.aspx (right) In 1.appx page,...
0
909
by: bjswart | last post by:
Hello, Here is the query I'm trying to run from a C# Windows Program for a Login Form. SELECT CAST(DecryptByCert(Cert_ID('PassEncryption'), Password) AS NVARCHAR) AS Password, A.* FROM Test,...
24
55047
by: =?Utf-8?B?U3dhcHB5?= | last post by:
Can anyone suggest me to pass more parameters other than two parameter for events like the following? Event: Onbutton_click(object sender, EventArgs e)" Event handler: button.Click += new...
12
11007
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
4
2921
by: ismailc | last post by:
Hi, I need help please. I need to create a textbox with a report url in an iframe below. Onclick of button create IFrame and pass textbox value into parameter of iframe src. I'm not to sure...
0
7384
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
7539
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
5686
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,...
0
4746
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...
0
3234
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...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
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...

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.