Print Page | Close Window

DialogBar Problem in VB.Net

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=13895
Printed Date: 07 October 2024 at 2:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: DialogBar Problem in VB.Net
Posted By: TShriver
Subject: DialogBar Problem in VB.Net
Date Posted: 01 April 2009 at 4:28pm

I have migrated our vb6 code to VB.net and have come upon an issue with the DialogBar in an MDI Form.  When an MDIchild is present on the form and the parent is resized, the Child flashes in the upper left of the form until the resize event is complete.  If there is no DialogBar the form resizes without any strange form drawing ghosts. 

In VB6 we used a PictureBox control as the container for the objects.  In VB.net the PictureBox is no longer a container so we have used the Panel control as the container.  Is there a correct way to use the DialogBar in .net or perhaps a work around? At the end of this post I have attached the CodeJock RibbonMDISample with the addition of a DialogBar to illustrate the problem.
 
Thank you for any help!
 
Tim
 
Here is a screen shot before the Resize:
 
Here is a screen shot during the Resize:
 
https://forum.codejock.com/uploads/20090401_162642_RibbonMDISample.zip - uploads/20090401_162642_RibbonMDISample.zip



Replies:
Posted By: Oleg
Date Posted: 02 April 2009 at 5:09am
Hi,
 
Add it before you setup PanelSummary as Dialog Bar
 
Me.Controls.Remove(PanelSummary)


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


Posted By: TShriver
Date Posted: 02 April 2009 at 8:50am
Oleg,
 
I'm confused.  When you say "Add it before you setup PanelSummary as Dialog Bar", what is the "it" you are referring too?
 
By "it" do you mean I should remove the DialogBar add the child form and then recreate the DialogBar???  I've tried that and other combinations.  Could you be more specific?
 
Thanks,
 
Tim
 
This is the FormLoad part of the code that was attached in the previous post from the RibbonMDI Sample.
 

        Private Sub frmMain_Load(ByVal eventSender As Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
            CreateRibbonBar()
 
            CommandBars.KeyBindings.Add(ID.FCONTROL, System.Convert.ToInt32("N"c), ID.ID_FILE_NEW)
            CommandBars.KeyBindings.Add(ID.FCONTROL, System.Convert.ToInt32("O"c), ID.ID_FILE_OPEN)
            CommandBars.KeyBindings.Add(ID.FCONTROL, System.Convert.ToInt32("S"c), ID.ID_FILE_SAVE)
            CommandBars.KeyBindings.Add(ID.FCONTROL, System.Convert.ToInt32("X"c), ID.ID_EDIT_CUT)
            CommandBars.KeyBindings.Add(ID.FCONTROL, System.Convert.ToInt32("C"c), ID.ID_EDIT_COPY)
            CommandBars.KeyBindings.Add(ID.FCONTROL, System.Convert.ToInt32("V"c), ID.ID_EDIT_PASTE)
            CommandBars.KeyBindings.Add(ID.FCONTROL, System.Convert.ToInt32("A"c), ID.ID_EDIT_SELECT_ALL)
 
            LoadIcons()
 
            Dim StatusBar As XtremeCommandBars.StatusBar = Nothing
            StatusBar = CommandBars.StatusBar
            StatusBar.Visible = True
            StatusBar.AddPane(0)
            StatusBar.AddPane(ID.ID_INDICATOR_CAPS)
            StatusBar.AddPane(ID.ID_INDICATOR_NUM)
            StatusBar.AddPane(ID.ID_INDICATOR_SCRL)
 
            DialogBar = CommandBars.AddDialogBar("TaskPanel", XtremeCommandBars.XTPBarPosition.xtpBarTop)
            DialogBar.Caption = "DialogBar"
            DialogBar.EnableAnimation = True
            DialogBar.Closeable = True
            DialogBar.EnableDocking(XtremeCommandBars.XTPToolBarFlags.xtpFlagAlignTop)
            DialogBar.Resizable = False
            DialogBar.ChildHandle = PanelSummary.Handle.ToInt32
            DialogBar.ShowGripper = False
            DialogBar.SetSize(1800, 48)
 
            RibbonBar().EnableFrameTheme()
 
            CommandBars.Options.KeyboardCuesShow = XtremeCommandBars.XTPKeyboardCuesShow.xtpKeyboardCuesShowWindowsDefault
 
            Dim ctrl As Control
            For Each ctrl In Me.Controls
                If TypeOf ctrl Is MdiClient Then
                    CommandBars.SetMDIClient(ctrl.Handle.ToInt32())
                End If
            Next ctrl
 
            '     Dim Workspace As XtremeCommandBars.TabWorkspace
 
            CommandBars.EnableCustomization(True)

        End Sub



Posted By: Oleg
Date Posted: 03 April 2009 at 12:56am
Hi,
 
By "it" I mean this line "Me.Controls.Remove(PanelSummary)" add "it" before "DialogBar = CommandBars.AddDialogBar"


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


Posted By: TShriver
Date Posted: 06 April 2009 at 10:08am
Thank you!
 
Tim



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