Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / April 2006

Tip: Looking for answers? Try searching our database.

Parmas from form to form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chook.harel@gmail.com - 28 Apr 2006 13:44 GMT
Maybe its not suppose to be in this group,
but i'm programming CF, so maybe it is :)
I'm trying to find out a good way of transfering data from one form to
the next one
and how is the change in forms occurs...

I tried
           frmSales frmSales = new frmSales();
           frmSales.Activate();
           frmSales.Show();
in the form that starts (in the program.cs class)
           frmWelcomeScreen frmWelcome = new frmWelcomeScreen();
           Application.Run(frmWelcome);

and I have 2 questions.

1. how can I use the frmwelcome contianers from the frmsales..
2. how do I close a form when i move to the next one,
so that when the user clicks the X button.. It won't return to the old
one,
and will exit the program.
Daniel Moth - 28 Apr 2006 14:16 GMT
Many solutions depending on specific requirements.

Easiest in your case, keep a reference to frmwelcome at the class/form
level. If you have a reference you can call methods on it (e.g. Close) and
you can hook up to events from it (e.g. Closing).

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

> Maybe its not suppose to be in this group,
> but i'm programming CF, so maybe it is :)
[quoted text clipped - 17 lines]
> one,
> and will exit the program.
chook.harel@gmail.com - 28 Apr 2006 14:31 GMT
but the first class is static (main)
how can i make a refrence to it?
Daniel Moth - 28 Apr 2006 15:35 GMT
Your forms are not static though right? That is what you were asking
originally.

If you are saying how to reference the main form (the one you pass to
Application.Run) from the static method Main, then I don't follow: Why do
you want to do that? When your main form closes, so will your app (assuming
no other threads are running).

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

> but the first class is static (main)
> how can i make a refrence to it?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.