Question Form Values

solfinker

Well-known member
Joined
Aug 6, 2013
Messages
71
Programming Experience
Beginner
Hello.
I have several forms with some shapes and one picturebox on them.
I update the values of the shapes and the picturebox once per minute.
When I open (show()) the form it takes up to 1 minute for the shapes and the picturebox to grasp the values. I mean: Whenever I open (show()) the form, the shapes and the picturebox appear with the initial values that are declared on the form design, and not the ones assigned by the program in a former loop.
I suppose I can avoid this by using
VB.NET:
Form.Visible = True
instead of
VB.NET:
Form.Show()
, but when I close the windowform by clicking on the Close Button everything is lost again, because then I'll have to open (show()) it again.

Any hints?
Can I convert the Close Button in a different event v.gr.
VB.NET:
Form.Visible = False
 
Setting the Visible property to True instead of calling Show will achieve nothing and hiding the form instead of closing it is a hack. If the code you have is not working then the code is wrong. You haven't shown us the code so there's no way that we can know what's wrong with it.

In general, you need to either pass data to the form before calling Show, either by passing arguments to the constructor or some other method or by setting properties, or else the form needs to grab the data it needs when it loads, i.e. in the Load event handler. If that's not what you're doing then that's why it's not working. If that is what you're doing then you did it wrong.
 
Back
Top