Results 1 to 2 of 2

Thread: Tab control style

  1. #1
    Member zlatkoAB's Avatar
    Join Date
    Apr 2008
    Age
    48
    Posts
    282
    Blog Entries
    1
    Rep Power
    38

    Tab control style

    hi
    In thinBasic examples is tab control example, but from
    code i cannot figured which style use this tab control?
    I see that notification mesages are recived under WM_NOTIFY right?

    so there is no TCN_SELCHANGE used at all or i am wrong.

    i ask this question here becuse i dont get it why something similar don't work in
    oxygen ?


    thanks in advance

    Aurel

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,183
    Blog Entries
    2
    Rep Power
    10
    Hi Aurel,

    in many situations, all the hard work a programmer has to do with Windows Controls is done by thinBasicitself.
    Here below internal thinBasic function (PowerBasic code) handling Tab changing active tab control window.

    Hope this can help.

    Ciao
    Eros


      '-----------------------------------------------------------------------
      Function Exec_TabCtrl_OnNotify() As Ext
      '-----------------------------------------------------------------------
        Local eDlg        As Ext
        Local eCtrl       As Ext
        Local eLParam     As Ext
        Local pNMHDR      As NMHDR Ptr
        Local hTab        As Long   
        Local tItem       As TC_ITEM
        Local PageNo      As Long  
        
        thinBasic_Parse3Numbers(eDlg, eCtrl, eLParam)
        If thinBasic_ErrorFree Then
    
    
          Control Handle eDlg, eCtrl To hTab
    
    
            pNMHDR = eLParam
            '---Used to hide/show child windows based on current selected TAB
            '---Now we check if the control handle firing the event is our TAB Control handle
            '---Remember: control handle, not control ID. We can get control handle using CONTROL_GetHandle function
            If @pNMHDR.hWndFrom = hTab Then
              '---OK, our TAB has generated the notification event. We need to check what message has been sent
              Select Case @pNMHDR.Code
                  Case %TCN_SELCHANGING
                    '---Fired just before changing
                    PageNo = TabCtrl_GetCurSel(hTab)
    
    
                    tItem.mask    = %TCIF_PARAM
                    TabCtrl_GetItem (hTab, PageNo, tItem)
                    
                    If tItem.lParam Then               
                      Dialog Show State tItem.lParam, %SW_HIDE
                    End If                                    
                    
                  Case %TCN_SELCHANGE
                    '---Fired just after change
                    PageNo = TabCtrl_GetCurSel(hTab)
    
    
                    tItem.mask    = %TCIF_PARAM
                    TabCtrl_GetItem (hTab, PageNo, tItem)
    
    
                    If tItem.lParam Then               
                      Dialog Show State tItem.lParam, %SW_SHOW
                    End If
              End Select
            End If
        End If
    
    
      End Function
    
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Similar Threads

  1. Replies: 1
    Last Post: 29-08-2013, 22:50
  2. thinBasic and Windows 8 Metro Style
    By omarpta in forum thinBasic General
    Replies: 4
    Last Post: 28-08-2012, 18:02
  3. Dialog style updates
    By Michael Clease in forum Fixed or cleared errors in help material
    Replies: 1
    Last Post: 08-11-2007, 07:52
  4. Coding Style Ideas
    By kryton9 in forum thinBasic General
    Replies: 2
    Last Post: 13-12-2006, 21:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •