CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    May 2011
    Posts
    44

    [RESOLVED] Hiding/Unhiding txt boxes on a form

    I have a combo box on my form, that has 2 options to select from. When my form loads, under the form_Load() Event I have numerous text boxes set to ...Visible = False; Depending upon what selection is chosen within that combo box, I want specific text boxes to become viewable.

    I.E. If comboboxAnswer = Tester1
    {
    ...Visible = True;
    ...Visible = True;
    }

    But I don't know where these lines of code would need to go that would let those text boxes be visible.

    Code:
    Private Void Form_Load()
    
                txtAirlineName.Visible = false;
                txtNumberofPassengers.Visible = false;
                txtFlightNumber.Visible = false;
                txtFighterType.Visible = false;
                lblPassengerPlaneData.Visible = false;
                lblAirlineName.Visible = false;
                lblNumberofPassengers.Visible = false;
                lblFlightNumber.Visible = false;
                lblFighterJetPlaneType.Visible = false;
                lblFighterType.Visible = false;
    
                cboAA.Items.Add("Test1");
                cboAA.Items.Add("Test2");
    Last edited by jo15765; August 13th, 2011 at 07:43 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured