Results 1 to 8 of 8

Thread: [RESOLVED] Help with passing Class value

Threaded View

  1. #1

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Resolved [RESOLVED] Help with passing Class value

    hello guys! I have 2 windows forms, form1 and form2, and a class named Model and I created an instance of Class model in form1 name EventData and assigned value to its fields using the code below

    FORM1
    Code:
    Model EventData = new Model();
    EventData.EventTitle = ArgEvntTitle;
    EventData.EvenDate = ArgEvntDate;
    EventData.EventLocation = ArgEvntLocation;
    Class Model
    Code:
    using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace RefNumGen 
    {
        
        public class Model
        {
            private string _EventTitle;
            private string _EventDate;
            private string _EventLocation;
    
            public string EventTitle
            {
                get { return _EventTitle; }
                set { _EventTitle = value; }
            }
    
            public string EvenDate
            {
                get { return _EventDate; }
                set { _EventDate = value; }
            }
    
            public string EventLocation
            {
                get { return _EventLocation; }
                set { _EventLocation = value; }
            }     
        }
    }
    my question is how can pass that instance,EventData, to an Instance of Class Model in form2?
    Last edited by daimous; Nov 15th, 2006 at 02:42 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width