C# check if Form was opened with arguments when button is clicked -


i want re-use form, , behaviour of button should change, depending if form opened arguments or not. form opened code:

public partial class followup : form {     public followup(string so)     {         initializecomponent();     [code]     } } 

and outside form code button click code:

private void btnsavechanges_click(object sender, eventargs e) {     if (string != "")     {         code     } } 

how can button click event recognize if there argument when opening form? (the string 'so' not recognized in button code).

well, followup class defined

public partial class followup : form {     private string _so;      public followup(string so)     {         initializecomponent();         _so = so;         [code]     }      private void btnsavechanges_click(object sender, eventargs e)     {         if (_so != "")         {             code         }     } } 

key idea: store so variable passed in coustructor class private field _so , use sotred value when needed.


Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -