c# - I am trying to add user input from the second form with title, description to my Data array but can't -


namespace to_do_list_application {     public partial class create_new_task : form     {         public create_new_task()         {             initializecomponent();         }          private void button1_click(object sender, eventargs e)         {              data[] add_item = new data[10];               add_item[1] = new data(title_input); // error data not contain constructor takes 1 argument           }   // data class on program.cs ////////////////////////////////////////////////////////////////  public class data     {         // menu (form)         public int priority;         public string title;         public string description;           // create new task (form)         public datetime calender;         public string description_2;         public int tick;         public data(int priority, string title, string description, datetime calender, string description_2, int tick)         {             // menu (form)             title = title;             description = description;              // create new task (form)             calender = calender;             description_2 = description_2;             tick = tick;             priority = priority;      } 

when try create new data object have use contructor takes 6 arguments.in case code should somethinglike :

add_item[1] = new data(5,"title", "description", new datetime(2015, 4, 25), "desc2",3); 

creating new object happens through constructors :

public data(int priority, string title, string description, datetime calender, string description_2, int tick)

is constructor , can create new data object these 6 arguments.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -