Box

Box

  • NA
  • 51
  • 41.5k

variable for an open window

Jul 4 2012 10:06 AM
I have a program which opens multiple windows. its the same window but has mutliple instances with different data contained in it.

im wanting to update them individually later on in code. i figured my easiest way would be to create a variable and then set it to contain a link to a currently open window (not sure if this is actually possible though)

i have a public function in the new window that is open that can receive data when it is first created so i know that part works.
each form when it is created has a new name so I can use Application.OpenForms["formname"] to activate it, minimize it etc etc

I just need something like:


varForm = Application.OpenForms[formname]
so I can then do
varForm.PassInfo("some text to be added in to the window")

hope this makes sense to someone! If im going about this the wrong way then please let me know a better way of doing it. I am still pretty new to c# programming and still have a whole lot to learn.

thanks

Answers (1)