hi,

1) how can a user close a tab page including the tab after viewing it??

2) how do i disallow the user from opening the 2 or more of the tab page? (my tab page is opened by button click) i dont want to disable the button after opening 1 tab page.. any other ways to disallow opening the same tab page?


thanks

need to see the code where you open the tab page

Seems to me that, if you're wanting USER action to close the tab page, then you would need to have code that would hide the tab page when a certain event occurs (like a button click or a change to a field value).

Not sure I understand the second question; unless I'm confused by what you refer to as a "tab page", tab controls can only display one page at a time by design. If you're wanting to keep a user from RE-OPENING a previously viewed tab, then you might be looking at some sort of conditional disabling of the page after it has been displayed.

I'm not a good enough coder yet to give you any more technical detail than that, but hopefully the conceptual info will guide you in the right direction.

I'm thinking he is opening a window/form that has several tabs and he wants to prevent the user from opening more than one window/form. But that is just a guess. Need more details from him if he wants help.

hi

thanks for all those replies.

i managed to solve the first question (to close a tab page after viewing) by adding a button to the tab page n writing the click event>> tabControl1.TabPages.Remove(tabPage1);

for the 2nd problem (not to allow user to open the same tab page when one is currently opened), i set conditions to >>

if (tabControl1.TabPages.Contains(tabPage1)) // Check if a tabpage is already opened
                {
                    // To cause no effect when button to open tab page is clicked after one tabpage is opened

                }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.