I recently started using the skins in visual basic 6.0. I basically used the code from the example to try to use it. I am also using the commandbar control to create the menu and the toolbar.
I added the skin code after the creation of the menu and toolbar. However, when I load the form it starts up, then a second into it the border at the top disappears. I stepped thru the code and it looked like the commandbar resize is readjusting the file menu and toolbar to cover the top border, but I took out the code and it still did it.
below is my code. Should I do something different since I am using the command bar with the skin? It is hard to know what to do without a tutorial or manual.
Thank you for the help.
Private Sub Form_Load() On Error GoTo ErrorHandler
CommandBarsGlobalSettings.App = App
Dim Control As CommandBarControl Dim ControlFile As CommandBarPopup Dim ControlView As CommandBarPopup Dim ControlHelp As CommandBarPopup Dim ControlAbout As CommandBarPopup
Dim ToolBar As CommandBar
Dim StatusBar As StatusBar
' START MENU BAR CODE
Set ControlFile = CommandBars.ActiveMenuBar.CONTROLS.Add(xtpControlPopup, 0, "&File") With ControlFile.CommandBar.CONTROLS .Add xtpControlButton, ID_PROGRAM_CLOSE, "Close Program" End With Set ControlView = CommandBars.ActiveMenuBar.CONTROLS.Add(xtpControlPopup, 0, "&View") With ControlView.CommandBar.CONTROLS .Add xtpControlButton, ID_VIEW_TOD, "View Tip of the Day" End With Set ControlHelp = CommandBars.ActiveMenuBar.CONTROLS.Add(xtpControlPopup, 0, "&Help") With ControlHelp.CommandBar.CONTROLS .Add xtpControlButton, ID_GET_LIVE_HELP, "Get Live Help" End With Set ControlAbout = CommandBars.ActiveMenuBar.CONTROLS.Add(xtpControlPopup, 0, "&About") With ControlAbout.CommandBar.CONTROLS .Add xtpControlButton, ID_ABOUT_PEP2006, "About PEP 2006" End With ' START TOOL BAR CODE Set ToolBar = CommandBars.Add("Report Bar", xtpBarTop) ADDBUTTON ToolBar.CONTROLS, xtpControlButton, ID_COVER_SCREEN, "View Start Screen", True, "View Start Screen" ADDBUTTON ToolBar.CONTROLS, xtpControlButton, ID_OBSV_REPORT, "Teacher Observation Report", True, "Go to Teacher Observation Report" ADDBUTTON ToolBar.CONTROLS, xtpControlButton, ID_TPAI_REPORT, "Teacher Performance Appraisal Report", True, "Go to Teacher Performance Appraisal Report" ADDBUTTON ToolBar.CONTROLS, xtpControlButton, ID_SNAP_REPORT, "SnapShot Report", True, "Go to SnapShot Report" ADDBUTTON ToolBar.CONTROLS, xtpControlButton, ID_PREOBSV_REPORT, "Pre-Observation Report", True, "Got to Pre-Observation Report" ToolBar.EnableDocking xtpFlagHideWrap CommandBars.VisualTheme = xtpThemeWhidbey CommandBars.ActiveMenuBar.ModifyStyle XTP_CBRS_GRIPPER, 0 CommandBars.ActiveMenuBar.EnableDocking xtpFlagStretched CommandBars.EnableCustomization False ' SET ICONS Set CommandBars.Icons = frmMain.ImageManager.Icons CommandBars.Options.UseDisabledIcons = True UseDisabledIcons = True CommandBars.Options.SetIconSize False, 16, 16
' START STATUS BAR CODE
Set StatusBar = CommandBars.StatusBar StatusBar.Visible = True StatusBar.AddPane 0 StatusBar.AddPane ID_INDICATOR_CAPS StatusBar.AddPane ID_INDICATOR_NUM StatusBar.AddPane ID_INDICATOR_SCRL frmMain.TabControl.CurrTab = 0 ' START SKIN CODE frmMain.SkinFramework.LoadSkin App.Path & "\WinXP.Royale.cjstyles", "NormalRoyale.ini" <TRIED BOTH WITH AND WITHOUT INI REFERENCE frmMain.SkinFramework.ApplyWindow frmMain.hWnd frmMain.SkinFramework.ApplyOptions = frmMain.SkinFramework.ApplyOptions Or xtpSkinApplyMetrics
Exit Sub ErrorHandler: ErrorAlert.ErrorAlert Err.Number, Err.Description, "frmMain.Form_Load" End Sub
|