ҡդӶ ʵŧ 纺촨շ٨絴͵ ᷹ФѺ

͵Դҷҧ Inbox Ѻ

˹ѡ
-
VB 6/VB.Net
ASP/ASP.Net
Ѻ¤
¹ҹ Flash Movie
ռͺش  
 RSS Feeds
 ǹŴ RSS Reader ...   Download  RSS Reader

Forum - www.g2gnet.com
Webmaster - www.g2gnet.com
Visitors - Session views
 5 6 1 6 1 2 2

7 ѹҤ ..2549
76 Users On-Line.
Visitors - Page views
 8 9 7 3 8 6 5
1 Ҿѹ ..2551

Google   
g2gnet.com
Ҵѡ:  

÷ ToolBar Codejock Xtreme Suite Pro ActiveX

Category »  VB 6/VB.Net
: Webmaster 2/12/2553   : 15:32
(ҹ : 25399) 
硹ǡѺ CodeJock ActiveX
CodeJock Web Siteҵ¡ͧͧͧ ҡ餹˹Ҵҹ ˹ֹ (Ẻ) Ҫ¶·ʹ Developer ˹ҡл¡ѹ͡ҹѡ͡ СǺ͡ ͧäͧѹ 55555+ ... ҡѹ֧ҹ CodeJock ActiveX ǹ ͹ҧҹҡҡ ҡӾѧѺҡҧѹѧ Work Шеͧ¹ (٧ա) ѡ ͡˹仨ҡѧеͧդͧͧ Graphic Ҫ´ա (֡ѹͧФѺ) ... ѹբʹ ¢մӡѴͧ GIF ICO ҹѺ Visual Studio 98 ҧǹҹ ŧҧҺҺ GUI ѹ§ ҹҡ ... 繡÷ ToolBar 鴤觷ҡ¹ѡ 㨡ѹ˹ ШҾ PNG (Portable Network Graphic) ҹ Ҿ PNG öպѴҾŧ ·سҾͧҾŧ (ҡѡ) 觨дա GIF ICO ҡ¡¡ͧ ... How To and Do It ... Now
ǹŴ !!!
Codejock Xtreme Suite Pro ActiveX (ͧԴ駡͹¹ФѺ)

 ǹŴ Source Code ÷ ToolBar CodeJock ActiveX
ǹŴ Source Code ÷ CommandBars Designer CodeJock ActiveX

 ǹŴ Source Code ÷ SkinFrameWork CodeJock ActiveX

´÷ Skin Codejock Xtreme Suite Pro ActiveX
÷ Menu Codejock Xtreme Suite Pro ActiveX - Ҥ 1
÷ Menu Codejock Xtreme Suite Pro ActiveX - Ҥ 2
÷ Menu Codejock Xtreme Suite Pro ActiveX - Ҥ 3

͡Ẻ - Design Time ... ͡ Component ҧҾҴФѺ (ҡͧ)


͸ԺѺҧͧਤ


Ҿ鹩Ѻ (PSD) ͧ ToolBar շ 5 Ҿ 5 ¡ ФѺ

ѭ㹡óբͧͤ͹ٺ ...

ѹ ͤ͹ٺѹ ... 觼Դѹջѭҧ CommandBars Ѻ ImageManager ФѺ ... շҧ䢤Ѻͧ


Ŵ xcb ... Xtreme Command Bars ҷ
͡ Edit 价 Command Bars Designer ͹
ҡ仴 ÷ Menu Codejock Xtreme Suite Pro ActiveX - Ҥ 3 ͹ФѺ


Դ Command Bars Designer ѹͤ͹ҡٺ ӧҹ
͡ CommandBars --> Resource Symbols ...


ѧࡵҨеͧҤ 1022, 1023 1024 㹡ä͡¡ٺҹ
Export ӡ Save ͡繹ʡ BAS ( Module ФѺ)
Ҥسͧ ҨҵŢçѹѺФѺ ִҡ٨ԧҵͧҹҹ繾


Default ¤Ѻ ... ѹ֡ Resource.bas
ǹҨ Add Module ҹਤ Copy ੾ФҤ modDefinitions.bas (͡)

Ҥҡ Resource.bas
Public Const ID_FILE_MAIN = 1020
Public Const ID_FILE_MENU1 = 1022
Public Const ID_FILE_MENU2 = 1023
Public Const ID_PROGRAM_MAIN = 1021
Public Const ID_PROGRAM_MENU3 = 1024


ǹҷ ImageManager ͡ Properties ...


·


Ҥ繨ҡ Resource Symbols ФѺ 1022, 1023 1024


͡áҡ͹ 1022 ͡ Import and Export --> Import From Bitmap


͡ҿԤͧ չʡ PNG 觨դسҾͧҾա ICO GIF


ӵӴѺѺޤѺ ҵͧ͡Ҿҡ͹ ֧͡Ҥͧ


Ѿ͡ ... 仡ӫ͹ҨФúء


¡õǷ 1 ֧ ¡õǷ 5 ¡ ToolBar Ѻ

ҵͧСȵẺͧ͹ modDefinitions.bas ѧ
Option Explicit

' ûСȵẺͷ ToolBar 5
Public Const ID_USER_TOOLS_1 = 801
Public Const ID_USER_TOOLS_2 = 802
Public Const ID_USER_TOOLS_3 = 803
Public Const ID_USER_TOOLS_4 = 804
Public Const ID_USER_TOOLS_5 = 805

' Ţӹǹǡ繤ҷʧǹ 㹧ҹ
Public Const ID_INDICATOR_CAPS = 59137
Public Const ID_INDICATOR_NUM = 59138
Public Const ID_INDICATOR_SCRL = 59139

Ҵ鴡ѹ ...

Option Explicit

Private Declare Function InitCommonControls Lib "Comctl32.dll" () As Long

' ҧ TabToolBar
Public WithEvents TabToolBar As XtremeCommandBars.TabToolBar
'  ẺͧȰҺôѡ ... 55555+
'Public WithEvents TabToolBar As TabToolBar

' ҧ StatusBar
Dim WithEvents StatusBar As XtremeCommandBars.StatusBar

' ###############################################
' ˵ءó㹡ä͡ ToolBar  MenuBar 价ӧҹҧ
' ###############################################
Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
    On Error Resume Next
    
    Select Case Control.Id
        '   TabToolBar Ҥ١˹ modDefinitions.bas
        Case ID_USER_TOOLS_1:
            MsgBox "س͡¡ ToolBar Ƿ 1"
        Case ID_USER_TOOLS_2:
            MsgBox "س͡¡ ToolBar Ƿ 2"
        Case ID_USER_TOOLS_3:
            MsgBox "س͡¡ ToolBar Ƿ 3"
        Case ID_USER_TOOLS_4:
            MsgBox "س͡¡ ToolBar Ƿ 4"
        Case ID_USER_TOOLS_5:
            MsgBox "س͡¡ ToolBar Ƿ 5"
            End
            
        ' óբͧ MenuBar ǡѹ ҹӤҤҡ Resource.bas ҹ
        Case ID_FILE_MENU1:
            MsgBox "س͡¡ MenuBar Ƿ 1"
        Case ID_FILE_MENU2:
            MsgBox "س͡¡ MenuBar Ƿ 2"
        Case ID_PROGRAM_MENU3:
            MsgBox "س͡¡ MenuBar Ƿ 3"
    End Select
    
End Sub

Private Sub MDIForm_Activate()
    frmMain.Caption = "ҧ÷ ToolBar  Xtreame SuitePro ActiveX - www.g2gnet.com"
    StatusBar(0).Text = "Ѳ : þ ʹʧ [email protected] [www.g2gnet.com]"
End Sub

Private Sub MDIForm_Initialize()
    InitCommonControls
End Sub

Private Sub MDIForm_Load()

    ' ҡԴӡѹ ҷӧҹ
    If App.PrevInstance Then End
    
    ' õ駤Ҥسѵ ªǹͧ㹢ͧ App
    '  App.Title, App.Path ҹҹ CommandBars Control
    CommandBarsGlobalSettings.App = App
    ' CommandBarsGlobalSettings  Properties ҹҡҡѺ  
    ' ҧ ...  CommandBarsGlobalSettings.ResourceFile = "XTPResourceArSa.dll"
     
    '  Control 㹡ҧͧ ToolBar
    Dim Control As CommandBarControl
    
    Me.Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2

    ' Ŵ Designer  CommandBars ... ҧٹФѺ
    CommandBars.LoadDesignerBars
    
    ' ͧ͹ (Stretched)
    CommandBars.ActiveMenuBar.EnableDocking xtpFlagStretched
    CommandBars.Options.KeyboardCuesShow = xtpKeyboardCuesShowWindowsDefault
    CommandBars.EnableCustomization False
    
    ' ʴ Theme ... ͡¤Ѻ
    'SkinFramework.LoadSkin App.Path + "\Styles\Office2007.cjstyles", "NORMALBLUE.ini"
    'SkinFramework.LoadSkin App.Path + "\Styles\Vista.cjstyles", "NORMALBLUE.INI"
    'SkinFramework.LoadSkin App.Path + "\Styles\Vista.cjstyles", "NORMALBLACK.INI"
    'SkinFramework.LoadSkin App.Path + "\Styles\Vista.cjstyles", "NORMALSILVER.INI"

    SkinFramework.LoadSkin App.Path + "\Styles\Office2007.cjstyles", "NORMALBLUE.ini"
    SkinFramework.ApplyWindow (Me.hWnd)
    SkinFramework.ApplyOptions = SkinFramework.ApplyOptions Or xtpSkinApplyMetrics
    CommandBars.PaintManager.RefreshMetrics
    CommandBars.RecalcLayout

    ' ¡ ToolBar
    Set TabToolBar = CommandBars.AddTabToolBar("UserTools")
    ' ͹حҵ/ź (Add or Remove Buttons) ѹҧҹشͧ ToolBar
    TabToolBar.ShowExpandButton = False
    
    ' ˹ҧ鹵شͧ ToolBar е (˹Ѵ Pixels)
    TabToolBar.MinimumWidth = 400
    
    ' 鹡 Control ѧ ToolBar
    With TabToolBar
        
        Dim iCount As Integer
        
        ' ҧ¡ ToolBar  ͡ "User Tools" շ 5 
        ' Ҥ ID_USER_TOOLS е 仡˹ǧ˹ͧ modDefinitions.bas
        For iCount = ID_USER_TOOLS_1 To ID_USER_TOOLS_5
            Select Case iCount
                Case 801: Set Control = .Control.Add(xtpControlButton, iCount, "¡õǷ 1")
                Case 802: Set Control = .Control.Add(xtpControlButton, iCount, "¡õǷ 2")
                Case 803: Set Control = .Control.Add(xtpControlButton, iCount, "¡õǷ 3")
                Case 804: Set Control = .Control.Add(xtpControlButton, iCount, "¡õǷ 4")
                Case 805: Set Control = .Control.Add(xtpControlButton, iCount, "¡õǷ 5")
            End Select
        Next
    End With
    
    ' Сȵ Array ӹǹ ToolBar ͧҧ ʴٻ Icon
    ' 㹵ҧ 5  鹨ҡ 0 ֧ 4
    Dim icoIconArray(0 To 4) As Long
    
    icoIconArray(0) = ID_USER_TOOLS_1
    icoIconArray(1) = ID_USER_TOOLS_2
    icoIconArray(2) = ID_USER_TOOLS_3
    icoIconArray(3) = ID_USER_TOOLS_4
    icoIconArray(4) = ID_USER_TOOLS_5
    
    ' ŴҾ PNG Ѻ ImageManager
    ImageManager.Icons.LoadBitmap App.Path & "\Icon\images.png", icoIconArray, xtpImageNormal
    
    ' Ѻ CommandBars ա  ToolBar ʴҾ Icon 
    CommandBars.Icons = ImageManager.Icons
    
    ' 駤ҢҴ Icon ͡Ẻ еǨբҴ 32x32 Pixel
    TabToolBar.SetIconSize 32, 32
    TabToolBar.ShowTextBelowIcons = True
    ' Դ͹ͧ ToolBar 
    TabToolBar.EnableDocking xtpFlagStretched
    TabToolBar.Closeable = False
    TabToolBar.Customizable = False
    
    ' ======================= ToolTips ==========================
    Dim ToolTipContext As ToolTipContext
    Set ToolTipContext = CommandBars.ToolTipContext
    ToolTipContext.Style = xtpToolTipOffice2007
    ToolTipContext.ShowTitleAndDescription True, xtpToolTipIconNone
    ' 駤ҵ˹觢ͧ ToolTip
    'ToolTipContext.SetMargin 2, 2, 2, 2
    ToolTipContext.MaxTipWidth = 180
    ToolTipContext.ShowShadow = True
    ' ======================= ToolTips ==========================
    
    ' ҧ StatusBar ҹҧͧ
    Set StatusBar = CommandBars.StatusBar
    StatusBar.Visible = True
    
    StatusBar.AddPane 0
    ' Ҥ˹ modDefinitions.bas 繤ʧǹ¹ŧ
    StatusBar.AddPane ID_INDICATOR_CAPS
    StatusBar.AddPane ID_INDICATOR_NUM
    StatusBar.AddPane ID_INDICATOR_SCRL
    StatusBar.IdleText = "Ѳ : þ ʹʧ [email protected] [www.g2gnet.com]"

End Sub
Conclusion:
鴢ͧҧ ToolBar ǹ ҧ TabbedToolBar Sample ͧ CodeJock ФѺ 鹩Ѻҷҡ鹨Թ 繧駹ҹͧҹ ҨҪͧҧ͡ 鴹١ҹԧɳ (G2GNet PostCode Thailand) ٻ´ ... ׹ѹҼѹ˹Ҵҹ ˹ֹ ˹ҷ ˹ § ҹԧᨡѹ ... 55555+ ... зͧ͹


ͺ˹ ... з ToolBar ѹҧ ...


͵ - g2gNet Dot Com
Ţ¹ҳԪ硷͹ԡ 0407314800231
CopyLeft © 2004 - 2099 g2gNet.Com All rights reserved.
Email: [email protected] . 08-6862-6560