If you are trying to get form2 to read properties of form1 consider refactoring it to have methods on form2 that you pass the needed values from form1, possibly on an overloaded constructor. Thus, you add the following to form2:
Private _param1 as string Private _param2 as string
Public Sub New(param1 as string, param2 as string)
me.New() SetParameters(param1, param2)
End Sub
Public Sub SetParameters(param1 as string, param2 as string)
_param1=param1 _param2=param2 me.Invalidate()
end sub
Then in your Form2_paint method, refer to these parameters. If you need to update it after you create the form, you can consider adding a call from form1 to SetParameters with the new values. Form2's Paint method should get called due to the Invalidate command.
Jim Wooley http://devauthority.com/blogs/jwooley
|