Print Page | Close Window

VB.NET upgrade of VB6 application

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=3001
Printed Date: 05 October 2024 at 11:12pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: VB.NET upgrade of VB6 application
Posted By: olofh
Subject: VB.NET upgrade of VB6 application
Date Posted: 04 October 2005 at 10:44am

Command Bars ActiveX works fine when IsMDiContainer property of main form is set to False; however, the menu does not display if set to True.

I created a simple test Windows Application project using Visual Studio 2005 RC, and then added a COM reference to Xtreme CommandBars ActiveX Control 9.60. 

Test form load looks like this...

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim m_menuBar As XtremeCommandBars.CommandBar
        m_menuBar = Me.CommandBarsMgr.ActiveMenuBar

        Dim Control As XtremeCommandBars.CommandBarControl
        'turn off expand arrow (right arrow on tool bar)
        Me.CommandBarsMgr.Options.ShowExpandButtonAlways = False
        m_menuBar.Closeable = False

        Dim FileMenu As XtremeCommandBars.CommandBarControl
        FileMenu = m_menuBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpC ontrolPopup, 0, "&File")
        FileMenu.Id = 2100

        With FileMenu.CommandBar.Controls
             'UPGRADE_WARNING: Couldn't resolve default property of object FileMenu.CommandBar. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keywor d="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
             .Add(XtremeCommandBars.XTPControlType.xtpControlButton, 2101, "&New Client File")
             'UPGRADE_WARNING: Couldn't resolve default property of object FileMenu.CommandBar. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keywor d="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
             .Add(XtremeCommandBars.XTPControlType.xtpControlButton, 2102, "&Open Client File...")
             'UPGRADE_WARNING: Couldn't resolve default property of object FileMenu.CommandBar. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keywor d="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
             .Add(XtremeCommandBars.XTPControlType.xtpControlButton, 2103, "&Save Client File")
             'UPGRADE_WARNING: Couldn't resolve default property of object FileMenu.CommandBar. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keywor d="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
             .Add(XtremeCommandBars.XTPControlType.xtpControlButton, 2104, "Save Client File &As...")
        End With

        Me.CommandBarsMgr.ActiveMenuBar.Visible = True

    End Sub

 

 




Replies:
Posted By: Oleg
Date Posted: 05 October 2005 at 1:09am

Add this

Dim ctrl As Control
For Each ctrl In Controls
If (ctrl.GetType Is GetType(System.Windows.Forms.MdiClient)) Then
           CommandBars.SetMDIClient(ctrl.Handle.ToInt32)
End



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net