locked
Tabs RRS feed

  • Question

  •  

    Okay, I have a tabbed main window. When someone clicks a link on my main page, i want it to automatically switch the user to another tab and point the browser window in that tab to a website. I know how to navigate using the web browser, but how would I go about changing the tab?
    Wednesday, February 13, 2008 2:53 AM

Answers

  •  

    That's easy then.

     

    The links will have an event when they are clicked.  What you do is to execute

     

    tabcontrol.selectedtab = tabcontrol.tabpages(6)

     

    Or is it to be more datadriven then that?

    Wednesday, February 13, 2008 4:10 AM

All replies

  •  

    I'm wandering how to break some bad news. I guess I should begin by talking about architecture a little bit.

     

    There is IE which is a cluster of COM DLLs.  The webbrowser control is a wrapper around the IE DLLs but not all of the events are exposed.

     

    The event your StartNewWindow is not exposed in the webbrowser control.

     

    There are several ways to go about this. There is the axwebbrowser which is COM and in my eyes, a mess to work with in .Net code. OR

     

    There is a c# wrapper that works with the DLLS but exposes the StartNewWindow event. I've built a tabbed webbrowser using the extended-event c# wrapper. It's available on the Net.  You have to build it and get it ready to do from a C# project.

    Wednesday, February 13, 2008 3:13 AM
  • No, I'm not building a tabbed browser. I mean, well here, i'll include an image link.

     

    http://i96.photobucket.com/albums/l190/c89c/tabs.jpg

     

    See how the tabs are? I want that when someone clicks Website, the active tab switches to the web browser tab (like they had click on it). Once there I know how to navigate the web browser to a page. I just don't know how to get the tabs switch.

     

    Wednesday, February 13, 2008 3:28 AM
  • I'm slow tonight. The active tab does what....based on what sequence of events?

    Wednesday, February 13, 2008 3:31 AM
  • Okay. Basically, through code, I want to simulate them clicking on the Web Browser tab. For instance, I want to switch the view to the web browser tab, through the code. The code should do the same thing as if I had click on the tab. I mean, if I click on it, it will show the contents of that tab's page. That's what I want to do. When they click website, it switchs to the Web Browser Tab's page.

    Wednesday, February 13, 2008 3:35 AM
  •  

    I'm going to look slow again and ask a really specific question.....

     

    what is the datacoupling or discriminator upon which the selection is made.  I still have confusion, you have a link and click on it. Does the tab for the link exist yet? If so, how, in a data sense is the link and the tab related?

    Wednesday, February 13, 2008 3:43 AM
  • It exists yes. My program has a tabbed interface. It has eight tabs at the top, instead of consolodating all the information to one page and having them switch with a combo box or list box, i'm just having different tabs. So, when my program is created, the main window already has the tabs. Web Browser is the last tab, so tab 7 (6 in the collection) is the one I want to switch to when the link is clicked. It's a link label on the first tab, the "welcome" tab as I called it, has two link tabs. When either one is clicked on, they should switch the view to tab 7.

     

    I realize it might help to mention that all of the tabs are a member of a "TabControl" Container.

    Wednesday, February 13, 2008 3:49 AM
  •  

    That's easy then.

     

    The links will have an event when they are clicked.  What you do is to execute

     

    tabcontrol.selectedtab = tabcontrol.tabpages(6)

     

    Or is it to be more datadriven then that?

    Wednesday, February 13, 2008 4:10 AM
  • Nope, that's all I needed. Thanks so much.

    Wednesday, February 13, 2008 4:14 AM