PC Review


Reply
Thread Tools Rate Thread

How to access class instance of main form

 
 
=?Utf-8?B?RGlvbWF0YXM=?=
Guest
Posts: n/a
 
      22nd Aug 2004
I ve got tha start up mdi form frmMain and a customer class. I create a
public instance of Customer class. Then I want to use this instance at
another child form...

How can I refer to it?

Thank you in advance
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      22nd Aug 2004
Diomatas

Make it public/friend in the class you instance it.

Cor


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      22nd Aug 2004
* "=?Utf-8?B?RGlvbWF0YXM=?=" <(E-Mail Removed)> scripsit:
> I ve got tha start up mdi form frmMain and a customer class. I create a
> public instance of Customer class. Then I want to use this instance at
> another child form...


Add a property of type 'Customer' to your main form, for example, and
then read this property in your MDI children:

\\\
Dim TheCustomer As Customer = DirectCast(Me.MdiParent, MainForm).Customer
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Instance name of main form Jon Microsoft C# .NET 4 23rd Aug 2007 08:49 AM
Trap the instance where navigating to end of sub form moves to Main form? KC Microsoft Access Forms 2 26th Apr 2007 04:23 PM
How do I use a class, when the class requires functions in the main form? Bmack500 Microsoft VB .NET 7 7th Jun 2006 04:11 PM
Main form instance name Bill D Microsoft C# .NET 2 12th Dec 2003 07:05 PM
Re: Instance name of the Main Form of an application Henke Microsoft Dot NET 2 5th Dec 2003 07:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:11 PM.