Which form event to use?

  • Thread starter Thread starter dbuchanan
  • Start date Start date
D

dbuchanan

I want to show or hide controls on the form based on the value of an
exiting public boolean value.

Me.btnAddRow.Visible = bDataEntry

Which form event does this belong in? putting it in the Form_Load event
does not work.

Should it be put in just after the initialize component?
(I have verified that the boolean has the value.)
 
Hi,

Since it's a public boolean variable and you wish to change the control's visibility immediately on runnint the application, you can also use
"Form_Activated" event.
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated

Me.Button1.Visible = False

End Sub

This should work.

Thanks

Mona [GrapeCity]
 
Back
Top