473,509 Members | 2,890 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I Overload Show() Method?

Could someone please explain how I overload the Show() method of a form?

Suppose I select a record from a datagrid on Form1, then I want to show the
details of the selected record by opening Form2 using say the CustomerID as
an 'argument' to the Show method.

So, in Form1 I would have code such as:

Sub GetSelectedRecord()
Form2.Show(CustomerID)
Me.Close()
End Sub

.... and in Form2 I woudl have code such as:

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
..... code to read a record from a database using the CustomerID
End Sub

Many Thanks

Paul.

Nov 20 '05 #1
1 6621
"Paul Fairless" <pa**@fairlesshouse.freeserve.co.uk> schrieb
Could someone please explain how I overload the Show() method of a
form?

Suppose I select a record from a datagrid on Form1, then I want to
show the details of the selected record by opening Form2 using say
the CustomerID as an 'argument' to the Show method.

So, in Form1 I would have code such as:

Sub GetSelectedRecord()
Form2.Show(CustomerID)
Me.Close()
End Sub

... and in Form2 I woudl have code such as:

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
..... code to read a record from a database using the
CustomerID
End Sub


Private m_IDCustomer As Integer

Public Overloads Sub Show(ByVal IDCustomer As Integer)
m_IDCustomer = IDCustomer
'you can place the "code to read a record from a database using the"
'here or in the load event.

MyBase.Show()
End Sub

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

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

Similar topics

10
2421
by: =?Utf-8?B?QWxiZXJ0IEZ1?= | last post by:
Hi, my function: myAdjustForm.Show(); I am using the Show method to show the pop-up window to the users in my C# program. I found that I have invoke this function TWICE at the beginning...
4
2654
by: JamesG | last post by:
Hi, I'm new to C-Sharp (as of today) and i'm struggling to implement a SOAP client to a PHP5 web service. I have added the Web Reference (do I also need to use wsdl.exe and compile the .dll, and...
0
837
by: odelial | last post by:
can i overload web method c#c 2003? and if yes how? :) thanks
11
28037
by: Gary James | last post by:
I'm using an object data type variable to pass a numeric value (Int, Float, Double, etc) to a function that returns a formatted string. However, nullable types do not provide an overridden...
4
12818
by: kj123 | last post by:
No overload for method 'Question' takes '0' arguments...plz reply me
3
2186
by: Mucahit ikiz | last post by:
Can you help me please, I have this error message "No overload for method 'GetDataByClassType'takes '1' arguments" private void button7_Click(object sender, EventArgs e) { string...
5
4986
by: DaveRook | last post by:
Any ideas with this? HTML page <%#loc(Eval("B", "U", "M", "S"))%> code behind public String loc(object o1, object o2, object o3, object o4) { string s = Convert.ToString(o1) +...
5
1706
by: Rene Canter | last post by:
Trying to run an NUnit test to store and retrieve an item and ensure that the item retrieved is the same as the item stored. public void TestStoreAndRetrieve() { ...
0
7234
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
7136
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
7344
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
7412
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...
1
7069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5060
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...
0
4730
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
3216
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...
1
775
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.