Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > .NET Framework 1.x
|
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 27th, 2006, 02:55 AM
Registered User
 
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot transfer data between different Forms


Hello guys...

I am new to this forum and new to DotNet too..I am on C# track and currently facing the problem described below.I am practicing on VS2002 and 1.1 framework and my OS is windows XP.
As i am new to this forum, i dont know this query has been asked by anyone before..if yes then please send me the link to the page..ThankYou

Problem:
I am having two forms in my application(Form1 and Form2).Form1 is startup form.Form1 contains a richtextbox and a button.This button opens Form2.Form2 contains a datetimepicker and a button.
Now what i want to do is, when i click the button of Form2, i want the richtextbox to show the date (datetimepicker.text). i dont know how to pass data from 1 form to another..please help me as soon as possible..

Thankyou;

Logically _Yours

 
Old February 1st, 2006, 12:54 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You need to use JavaScript or you can use a session variable. The session variable would be the easiest way.

 
Old September 15th, 2006, 12:09 AM
Registered User
 
Join Date: Sep 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

  It is better to creat one constructor in that form. For example if you want to pass data from Form2 to Form1, create a constructory in
form 1

public Form1(string s)
{
richTextBox1.Text=s;
}


and write the following code in the Form 2

Form1 obj=new Form1(Convert.ToString(dateTimePicker1.value));
obj.Show();

thank you,










Similar Threads
Thread Thread Starter Forum Replies Last Post
DATA TRANSFER vish_vj ADO.NET 1 March 7th, 2008 01:16 PM
Transfer access2003 forms to word document q2q2 BOOK: Access 2003 VBA Programmer's Reference 0 December 29th, 2006 11:21 AM
Transfer data mepancha SQL Server 2000 4 March 24th, 2005 04:29 PM
Transfer data between forms haiying .NET Framework 2.0 4 September 16th, 2004 09:07 AM
Data Transfer psingh SQL Server 2000 8 June 9th, 2003 06:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.