c# - How to display graph in another windows forms Form -


i'm working on windows forms applications, , far seems pretty simple. have form takes user input , displays in graph in current form.

i want modify application main form takes input, , after "go" button pressed, taken data graphed, time in new form should open up. if user input new info main form, press "go" yet form should pop graph newly inputed data, , on. multiple forms different graphs can open @ once.

i'm not sure how modify application achieve this. created new form class , added graph control , other controls , design want these new graph forms have, when i'm trying plot data original main form, i'm not sure how can access new graph form's graph control values... set modifiers public, can't seem work.

is there way more plot data 1 form new object of graph form created?

create new form graphing form. add properties form represent data. can pass data constructor of form. example, if had graph title , list of integers graph data, form might this:

public partial class graphform : form {      public string graphtitle { get; set; }     public list<int> graphdata { get; set; }       public graphform(string graphtitle, list<int> graphdata )     {         initializecomponent();          graphtitle = graphtitle;         graphdata = graphdata;     }      private void graphform_load(object sender, eventargs e)     {         // plotting here.     } } 

now when user clicks go button, can create new form , pass in data needs @ time:

private void gobutton_click(object sender, eventargs e) {     graphform form = new graphform("title", new list<int>() {1,2,3} );     form.show(); } 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -