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

Re: Which form event to use? by Mona

Mona
Wed Jul 13 23:51:15 CDT 2005

This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C5885D.C3EFB5D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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=20
"Form_Activated" event.
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As =
System.EventArgs) Handles MyBase.Activated

Me.Button1.Visible =3D False

End Sub

This should work.

Thanks

Mona [GrapeCity]



"dbuchanan" <dbuchanan52@hotmail.com> wrote in message =
news:1121303082.108976.163630@g43g2000cwa.googlegroups.com...
>I want to show or hide controls on the form based on the value of an
> exiting public boolean value.
>=20
> Me.btnAddRow.Visible =3D bDataEntry
>=20
> Which form event does this belong in? putting it in the Form_Load =
event
> does not work.
>=20
> Should it be put in just after the initialize component?
> (I have verified that the boolean has the value.)
>
------=_NextPart_000_000A_01C5885D.C3EFB5D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2668" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Since it's a public boolean variable =
and you wish=20
to change the control's visibility immediately on runnint the =
application,&nbsp;=20
you can also use </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>"Form_Activated" event.</FONT></DIV>
<P><FONT face=3DArial size=3D2>Private Sub Form1_Activated(ByVal sender =
As Object,=20
ByVal e As System.EventArgs) Handles MyBase.Activated</FONT></P>
<P><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; Me.Button1.Visible =3D =

False</FONT></P>
<P><FONT face=3DArial size=3D2>End Sub</FONT></P>
<P><FONT face=3DArial size=3D2>This should work.</FONT></P>
<P><FONT face=3DArial size=3D2>Thanks</FONT></P>
<P><FONT face=3DArial size=3D2>Mona [GrapeCity]</FONT></P>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</P>
<DIV><FONT face=3DArial size=3D2>"dbuchanan" &lt;</FONT><A=20
href=3D"mailto:dbuchanan52@hotmail.com"><FONT face=3DArial=20
size=3D2>dbuchanan52@hotmail.com</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote in=20
message </FONT><A=20
href=3D"news:1121303082.108976.163630@g43g2000cwa.googlegroups.com"><FONT=
=20
face=3DArial=20
size=3D2>news:1121303082.108976.163630@g43g2000cwa.googlegroups.com</FONT=
></A><FONT=20
face=3DArial size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt;I =
want to show or=20
hide controls on the form based on the value of an<BR>&gt; exiting =
public=20
boolean value.<BR>&gt; <BR>&gt; Me.btnAddRow.Visible =3D =
bDataEntry<BR>&gt;=20
<BR>&gt; Which form event does this belong in? putting it in the =
Form_Load=20
event<BR>&gt; does not work.<BR>&gt; <BR>&gt; Should it be put in just =
after the=20
initialize component?<BR>&gt; (I have verified that the boolean has the=20
value.)<BR>&gt;</FONT></BODY></HTML>

------=_NextPart_000_000A_01C5885D.C3EFB5D0--