Selectedpage dont work

2 posts, 0 answers
  1. Shaggy
    Shaggy avatar
    8 posts
    Member since:
    Jul 2013

    Posted 10 Nov 2013 Link to this post


    i have following forms:

    Dialogform: Is a form with a PageView - the Pageview have 2 Pages in it. Page A and Page B.

    Mainform: From here i'm opening the Dialogform. There are 2 Buttons - on Click the button shows the Dialogform as a Dialog (modal).
    • Button A: On click i want to show the Dialogform. Page A should be shown.
    • Button B: On click i also want to show the Dialogform but Page B should be shown.

    So when i'm starting my programm and i try the Buttons for the first time, everything works fine (with PageSelected).

    But when i'm clicking first Button A, then closing the Diaglogform and press Button B, it still show's me Page A. The selected Tab is the right one - Tab B is marked, but it still shows me the content from Page A.
    After that i need to switch manually in the Dialogform to Page A and then back to Page B, then it shows me the right Page.

    Meanwhile i found a solution, but i dont know if this is the right one. I need to dispose the Dialogform on closing and then it works fine.

    Is there any other solution for this issue?

  2. Dimitar
    Dimitar avatar
    1324 posts

    Posted 12 Nov 2013 Link to this post

    Hi Shaggy,

    Thank you for writing.

    Another way to solve this is to change the selected page in the VisibleChanged event of the dialog form. Also you will need a custom ShowDialog method in order to determine which button is clicked. The attached project contains a sample implementation of the described approach.

    I hope this helps. Should you have any other questions do not hesitate to ask.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft R3 2016 release webinar banner
Back to Top