I HAVE PHOTO ATTACHED

I'm trying to come up with some code that will make the 'Acct #' label and text box ONLY appear when some text is typed in the text box beside of 'Prime Broker', 'Custodian', etc.

Can anyone help? Thanks.

Attachments asdfa.jpg 52.91 KB

I HAVE PHOTO ATTACHED

I'm trying to come up with some code that will make the 'Acct #' label and text box ONLY appear when some text is typed in the text box beside of 'Prime Broker', 'Custodian', etc.

Can anyone help? Thanks.

In the designer, set the Visible property on the Acct # label and text box to false, and on the text entered event of each text box (Primer Broker, etc), set the Visible Property back to true.

I believe it is the textchanged event that you need.

So basically, on each textbox (prime broker, custodian..) create a textchanged event.

Now, on form_load hide the three textboxes -> broker1Textbox.visible = false.

In the textchanged event for each textbox, turn the appropriate hidden textbox's visibility to True.

that should do it.

Something like

Private Sub Broker1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Broker1.TextChanged
Me.AcctLabel1.Visible = (Broker1.text.length>0)
  End Sub

that way they will hide when you delete the text

This article has been dead for over six months. Start a new discussion instead.