473,661 Members | 2,465 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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnHelp.Click

Dim frmAdminHelp As New frmAdminHelp

frmAdminHelp.Sh ow()

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 4587
* "John Howard" <jo*********@dc f.state.fl.us> scripsit:
I am invoking a second form and would like to pass a parameter. My code is:

Private Sub btnHelp_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnHelp.Click

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


--
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*********@dc f.state.fl.us> scripsit:
I am invoking a second form and would like to pass a parameter. My code is:
Private Sub btnHelp_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) 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.Sh ow(Me)

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


--
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
23566
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
2929
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 and c#. So can anyone help me with the following: This one relates to a project I've started. How can I make the contents of textboxes in form1 available to form2
1
2302
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 Button control. While i chicking Form-A's Button i create a object for Form-B and show Form-B as Modaless Form. I entered some text in Form-B's textBox and press the Form-B's Button to close(Hide) the form Form-B, while closing i wants to pass
4
150913
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: session_set_save_handler(array(&$sess_handler, 'open'), array(&$sess_handler, 'close'), array(&$sess_handler, 'read'), array(&$sess_handler, 'write'), array(&$sess_handler, 'destroy'), array(&$sess_handler, 'gc'));
2
3344
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, I have a treeview control, I'd like to pass a selected node string to 2.aspx page and then to display some contents with passed node string. How could I accomplish that? The task is to pass the string parameter and
0
920
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, @Field1 AS A WHERE Test.EmpID = @Field0 The @Field1 Parameter is the second table with permissions that will change depending on the program. Thus the need to pass it in as a parameter. When I run this I get an error saying "Must declare Table...
24
55174
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 EventHandler(Onbutton_click); I want to pass more information related that event. & want to use that
12
11074
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. Here is a newbie mistake that I found myself doing (as a newbie), and that even a master programmer, the guru of this forum, Jon Skeet, missed! (He knows this I'm sure, but just didn't think this was my problem; LOL, I am needling him) If...
4
2943
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 how to do this, i think some javascript is needed as I want the button to check the textbox is not blank value first and then create iframe and pass textbox value as parameter. Does anyone have another method where there are 2 iframes: Having the...
0
8428
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
8341
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
8754
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
8630
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...
0
7362
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
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
4177
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
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.