Rapid-Q Documentation by William Yu (c)1999 Appendix A: QTABCONTROL

QTABCONTROL Component

QTabControl is a tab set that has the appearance of notebook dividers, except it is not made up of several pages. 


QTabControl Properties
FieldTypeR/WDefault




AlignINTEGERRWalNone
ButtonStyleINTEGERRWFalse
ClientHeightINTEGERRW
ClientWidthINTEGERRW
ColorINTEGERRW
CursorINTEGERRWcrDefault
EnabledINTEGERRWTrue
FlatButtonsINTEGERRWFalse
FlatSeperatorsINTEGERRWFalse
FocusButtonsINTEGERRWFalse
FontQFONTW
HeightINTEGERRW
HintSTRINGRW
HotTrackINTEGERRWFalse
LeftINTEGERRW0
MultiLineINTEGERRWFalse
ParentQFORM/QPANEL/QTABCONTROLW
PopupMenuQPOPUPMENUW
ScrollOppositeINTEGERRWFalse
ShowHintINTEGERRWFalse
TabARRAY of STRINGRW
TabHeightINTEGERRW
TabInactiveColorINTEGERRW
TabInactiveFontQFONTW
TabIndexINTEGERRW
TabOrderINTEGERRW
TabPositionINTEGER    RW
Changes location to opposite side and changes alignment of the tabs, values are 1, 2, 4, or 6 RW
TabWidthINTEGERRW
TagINTEGERRW
TopINTEGERRW0
WidthINTEGERRW
VerticalTabsINTEGERRWFalse
VisibleINTEGERRWTrue

QTabControl Methods
MethodTypeDescriptionParams




AddTabsSUBIAdd tabs to controlSTRING, Infinite
DelTabsSUBI
Delete tabs from controlINTEGER, Infinite
To delete a tab either
1) use the SnakeDile fixed RC.EXE dated November, 2006 or later. 
   OR
2) use a SUB that passes the QTabControl by reference and use DelTabs in the SUB like such:
    Sub TabDelete(DelTabIndx As Integer, Sender As QTabControl) 
         Sender.DelTabs(DelTabIndx) 
    End Sub

   Don't forget to change the QTabControl index after the call  (QTabControl.TabIndex = NewTabCnt)
InsertTabSUB (Index%, String$)Inserts Tab at Index%2

QTabControl Events
EventTypeOccurs when...Params




OnChangeVOIDTabs change0

Notes:
There are recent patches to the RapidQ libraries (.Lib and .DLL)  that provide XP theme TabControls if a manifest file exists, however
the TabInactiveColor, TabInactiveFont, and Color will not be available


QTabControl Examples

'' Tab Control Example for Rapid-Q by William Yu
'' When you hide a container (like QFORM, QTABCONTROL, and QPANEL), all the
'' components within it are also hidden.

$INCLUDE "RAPIDQ.INC"

DECLARE SUB TabChange

CREATE MainForm AS QForm
  Center
  Height = 300
  Width = 350
  Caption = "Tab Control demo"
  CREATE Tab AS QTabControl
    AddTabs "Tab 1","Tab 2","Tab 3","Tab 4"
    Width = MainForm.ClientWidth
    Height = MainForm.ClientHeight
    OnChange = TabChange
    HotTrack = True
    CREATE Panel0 AS QPanel
      Top = 40
      Left = 5
      Width = Tab.ClientWidth - 10
      Height = Tab.ClientHeight - 50
      Caption = "Panel 1"
      BevelInner = bvLowered
      CREATE Button1 AS QButton
        Caption = "Hello world!"
      END CREATE
    END CREATE
    CREATE Panel1 AS QPanel
      Top = 40
      Left = 5
      Width = Tab.ClientWidth - 10
      Height = Tab.ClientHeight - 50
      Caption = "Panel 2"
      BevelInner = bvLowered
      Visible = False
    END CREATE
    CREATE Panel2 AS QPanel
      Top = 40
      Left = 5
      Width = Tab.ClientWidth - 10
      Height = Tab.ClientHeight - 50
      Caption = "Panel 3"
      BevelInner = bvLowered
      Visible = False
    END CREATE
    CREATE Panel3 AS QPanel
      Top = 40
      Left = 5
      Width = Tab.ClientWidth - 10
      Height = Tab.ClientHeight - 50
      Caption = "Panel 4"
      BevelInner = bvLowered
      Visible = False
    END CREATE
  END CREATE
END CREATE


SUB TabChange
  SELECT CASE Tab.TabIndex
    CASE 0
      Panel0.Visible = True
      Panel1.Visible = False
      Panel2.Visible = False
      Panel3.Visible = False
    CASE 1
      Panel1.Visible = True
      Panel0.Visible = False
      Panel2.Visible = False
      Panel3.Visible = False
    CASE 2
      Panel2.Visible = True
      Panel1.Visible = False
      Panel0.Visible = False
      Panel3.Visible = False
    CASE 3
      Panel3.Visible = True
      Panel1.Visible = False
      Panel2.Visible = False
      Panel0.Visible = False
  END SELECT
END SUB


MainForm.ShowModal

Prev Component Contents Next Component