CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 1999
    Location
    UK
    Posts
    44

    How do I make a frame visible on top of everything else, including an SSTab

    I am stuck with trying to place a frame containing status information so that it is always visible on every tab of an SSTab Tabbed Dialog Control.

    I need to display a frame containing live status information in the same position and with the same content on each tab, without having to create an array of identical frames which would all need to be updated every time the status changes.

    I have tried to do this using ZOrder as shown below, without any luck.


    private Sub tabPte_Click(PreviousTab as Integer)
    ' Bring the status info to the front of everything, except on Options tab
    If (tabPte.Tab <> (tabPte.Tabs - 1)) then
    fraTrafficAlarms.ZOrder 0
    End If
    End Sub




    I have also considered moving the control from one tab to the other at runtime, but can't work out how to tell it which tab to show on. The code below (taken from MSDN Container Property example) gave me this idea, but I can't see how to apply it to my code.


    private Sub Form_Click()
    static intX as Integer
    Select Case intX
    Case 0
    set Command1.Container = Picture1
    Command1.Top= 0
    Command1.Left= 0
    Case 1
    set Command1.Container = Frame1
    Command1.Top= 0
    Command1.Left= 0
    Case 2
    set Command1.Container = Form1
    Command1.Top= 0
    Command1.Left= 0
    End Select
    intX = intX + 1
    End Sub




    The tabs take up my whole application area, a bit like the Win95/98 Display Properties dialog, but without the OK/Cancel buttons below the tabs.

    Thanks in advance to anyone who can help :-)

    Mark
    Regards

    Mark Rivers-Moore

  2. #2
    Join Date
    May 1999
    Posts
    4

    Re: How do I make a frame visible on top of everything else, including an SSTab

    Hi Mark,

    The answer in simple, and there is no code involved. All you have to do is create the frame on the form and NOT on the Tabbed Dialog Control. Once you've created the frame, drag the frame onto the required area of the tabs.

    When select any of the tabs, the frame should still be visible.

    Hope this helps.

    Vick Soulios



  3. #3
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: How do I make a frame visible on top of everything else, including an SSTab

    To explain Vicks answer a little:

    First create your SS tab . Then Create the other controls inside SS tab. SStab is a container control, so the child controls will stay put inside it.

    Then you select a frame control, and start its drawing somewhere on the (base) Form. SO that the frame is not a child of SS tab but the Form. Change the Frame to the size you want, and you may even place it over the SS tab itself. Since the frame was created after SStab, it is higher in the zorder, and hence can be positioned ON top.


    RK

  4. #4
    Join Date
    Nov 1999
    Posts
    3

    Re: How do I make a frame visible on top of everything else, including an SSTab

    You can put Picturebox on each tab, than put all your controls on each of this picture boxes instead of putting it on tab, then you can set container for your Status Frame to active picturebox.

    Private Sub SSTab1_Click(PreviousTab As Integer)
    Set StatusFrame.Container = Picture1(SSTab1.Tab)
    End Sub

    or you can use TabStrip control from Microsoft Windows Common Controls 6.0 component, it is not a container so it will stay below all of your controls anyway, but in this case you should change what would be visible for each tab by yourself.

    Vlado Bosnjakovic

    [email protected]


  5. #5
    Join Date
    Oct 1999
    Location
    UK
    Posts
    44

    Re: How do I make a frame visible on top of everything else, including an SSTab

    Many thanks for your help, this worked perfectly :-)

    Mark
    Regards

    Mark Rivers-Moore

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