none
tabconrol- using same textboxes and buttons in every tabpage RRS feed

  • Question

  • hi guys,

    i'm trying to duplicate 2  texboxes and 1 button for every month (total of 24 textboxes and 12 buttons) in 3 tab pages.

    every tab page represents a year

    2017

    2018

    2019

    every textbox.text get a number from my access depending the month and the customer i choose before.

    the button takes the data from the 2 texboxes of the month and do somthing.

    what is the way to do that?

    i can just copy-paste the data to all the tabs, and customize each button and textbox depending the month,

    but is there a samrt way?

    Wednesday, February 21, 2018 12:01 PM

All replies

  • hi guys,

    i'm trying to duplicate 2  texboxes and 1 button for every month (total of 24 textboxes and 12 buttons) in 3 tab pages.

    every tab page represents a year

    2017

    2018

    2019

    every textbox.text get a number from my access depending the month and the customer i choose before.

    the button takes the data from the 2 texboxes of the month and do somthing.

    what is the way to do that?

    i can just copy-paste the data to all the tabs, and customize each button and textbox depending the month,

    but is there a samrt way?

    Hi noampro8,

    According to your description, I am not sure what are you doing. Can you provide the code you already have?  Where  did you encounter  a problem?

    Best Regards,

    Cherry



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 23, 2018 5:39 AM
    Moderator
  • In order to repeat a similar area, consider User Controls. Make it using Project, Add User Control menu, place the textboxes and the button, etc. Add data members like Year, Month. The control will appear in Toolbox, and you can drag it to your tabs manually, or insert it programmatically. The buttons can be handled inside the User Control. There are containers, like FlowLayoutPanel, which helps too.

    Friday, February 23, 2018 6:51 AM
  • but is there a samrt way?

    Use Property binding.  Select the text box in the designer, select Application Settings \ Property Binding in the Properties pane, open the binding dialog, select the Text property, opne the dropdown, select New and enter a name. OK, OK.  Repat for the other text boxes, except that the name will already be in the Text dropdown, so select it instead of New.   All text boxes will now be tied to the same data source, so they will all show the same text.

    Friday, February 23, 2018 9:08 AM