CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009
    Posts
    12

    Question Set Values from one tab to another...

    Hi Guys,

    This issue is fairly simple and I'm sure there is an easy fix for this.

    Basically, I have a form that has a tab control and the default tab in the control has a mailing address. There is another tab for home address. On the default tab, I have a button that simply sets the current values in the mailing address fields to the home address fields on the other tab.

    However, this doesn't work unless I activate the 2nd tab and then go back to the first tab to click the button...

    private void button6_Click(object sender, EventArgs e)
    {
    mailingAddressTextBox.Text = homeAddressTextBox.Text;
    mailingCityTextBox.Text = homeCityTextBox.Text;
    mailingStateTextBox.Text = homeStateTextBox.Text;
    mailingZipTextBox.Text = homeZipTextBox.Text;

    }

  2. #2
    Join Date
    Dec 2008
    Location
    Pakistan
    Posts
    7

    Re: Set Values from one tab to another...

    I dont think there will be any issue regarding this. One thing that I can say is that you might be loading Home Address fields on Tab's activate event. Is this the case? If Yes, then do it on Form's load event and if this is not the case then the code should work.

  3. #3
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: Set Values from one tab to another...

    For this by default whenever you load the form set the default active window as the second tab windows always and then when you click on the button in the first tab it should work...

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