Which form event to use?

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.)
 
M

Mona

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top