Print Page | Close Window

Workspace w/ Max MDI child fails

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=744
Printed Date: 10 May 2024 at 4:24am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Workspace w/ Max MDI child fails
Posted By: markmbaker
Subject: Workspace w/ Max MDI child fails
Date Posted: 17 May 2004 at 11:11am
In the MDISample application, if I force the MDI child window to maximize itself but turn *off* the Max button for the window, the Workspace fails to appear.  The same also is true if I just turn off the Min button.  Essentially, I want to force the MDI child windows to appear maximized with no ability to minimize or restore them.    Is this a bug?



Replies:
Posted By: SuperMario
Date Posted: 18 May 2004 at 7:00am
CommandBars(1).SetFlags xtpFlagHideMDIButtons, xtpFlagHideClose


Posted By: nighthawk
Date Posted: 11 June 2004 at 9:15am
I have tried this and it is only partially working.  When the program loads, the minimize/restore/close buttons are there and all the loaded child forms appear maximized.  Only after I click the minimize or restore button and then maximize the child form again do the minimize and restore buttons dissapear.  How do I get them to disappear from the beginning when the program initially loads?


Posted By: SuperMario
Date Posted: 11 June 2004 at 9:23am
The line of code I provided will hide the minimize and maximize buttons, leaving only the close button appearing in the upper right corner on the menu bar.

You must set the WindowState to Maximized at design time for your child form.  This way your child form is automatically maximized when it is opened.


Posted By: nighthawk
Date Posted: 11 June 2004 at 9:45am
My problem is not getting the child forms to appear maximized when they are loaded, it is that the minimize and maximize buttons are not hidden when the program initially loads even though I include your line of code. 

So when my program loads, the child forms are maximized and the minimize/restore/close buttons are visible.

I click the restore or minimize buttons and the child forms change accordingly.

I then click the maximize button and the child forms change accordingly.

Only at this point do the minimize and restore buttons become hidden and the close button is the only visible option.  I want just the close button visible from the very beginning.


Posted By: SuperMario
Date Posted: 11 June 2004 at 9:51am
Where in your code are you hidding the buttons?  Maybe you can post a sample?  That same code is working fine for me.


Posted By: nighthawk
Date Posted: 11 June 2004 at 10:01am
I put it at the end of my MDIForm_Load event.  The name of my CommandBars control is "cbMain":

Set objWorkspace = cbMain.ShowTabWorkspace(True)
cbMain.VisualTheme = xtpThemeOffice2003
cbMain(1).SetFlags xtpFlagHideMDIButtons, xtpFlagHideClose






Posted By: SuperMario
Date Posted: 11 June 2004 at 11:23am
That looks correct.  Attach a sample project so I can debug.


Posted By: nighthawk
Date Posted: 15 June 2004 at 4:55am
I moved the code to be towards the beginning of the MDIForm_Load event and it is working now.  Something in the event, which I haven't yet identified, was keeping it from working correctly.  Thanks for your help.


Posted By: ccalhoun
Date Posted: 29 June 2004 at 7:37am

What commandbar is being used for this example?



Posted By: SuperMario
Date Posted: 29 June 2004 at 7:46am
The MDI buttons we are talking about appear in in the Menu Bar.  This is accessed via CommandBars(1) or CommandBars.ActiveMenuBar.  

Is this what you meant by "What commandbars is being used?" ?


Posted By: ccalhoun
Date Posted: 29 June 2004 at 8:01am

Is this set flag functionality exposed for toolbar controls?

If not how can you accomplish this independently of the CommandBars or the navigation mechanism?



Posted By: SuperMario
Date Posted: 29 June 2004 at 8:08am
The SetFlags method is only used for a CommandBar, specifically the MenuBar.  This is only used to add/remove the Maximize, Minimize, and Close buttons that appear at the far right of the MenuBar when a child window is maximized.

"If not how can you accomplish this independently of the CommandBars or the navigation mechanism?"

What specifically are you trying to accomplish?


Posted By: ccalhoun
Date Posted: 29 June 2004 at 8:12am

I would like to accomplish removing the minimize, maximize and close buttons from child forms when they are opened.

Any ideas?



Posted By: SuperMario
Date Posted: 29 June 2004 at 8:16am
CommandBars(1).SetFlags xtpFlagHideMDIButtons, 0



Posted By: ccalhoun
Date Posted: 29 June 2004 at 8:18am
What if the MDI child form is open from a toolbar click event?


Posted By: SuperMario
Date Posted: 29 June 2004 at 8:24am
You only need to specify the line of code I posted one time.  Then the buttons will not appear until you add some code to make them visible.  It doesn't matter how the form is opened.  Have you tried the code above to see if it does what you want?


Posted By: ccalhoun
Date Posted: 29 June 2004 at 9:43am

I have  tried this code but I use a Main Menu ManMenu1

Which doesn't expose SetFlags.

I am using a windows application with a MDI parent form and two children

With a MainMenu and a Toolbar.

the menu has to items (form1.form2)
the toolbar has two buttons(form1,form2)

Which object that I am using will expose setflags?

 



Posted By: SuperMario
Date Posted: 29 June 2004 at 10:10am
You are using the CommandBars control, right?  You can post a sample project to this post by clicking on the button that looks like a Winzip logo.


Posted By: ccalhoun
Date Posted: 29 June 2004 at 10:20am
No I am not I am just using windows controls. https://forum.codejock.com/uploads/ccalhoun/2004-06-29_102047_MDITest.zip - 2004-06-29_102047_MDITest.zip


Posted By: SuperMario
Date Posted: 29 June 2004 at 10:47am
That code will only work with the Codejcok CommandBars control.  Why are you not using the Codejock CommandBar? 


Posted By: ccalhoun
Date Posted: 29 June 2004 at 12:04pm

How could I from within VB.NET.

I downloaded the Toolkit but I don't see any assemblies that could be referenced from .NET

 



Posted By: SuperMario
Date Posted: 29 June 2004 at 3:59pm
I'm sorry, I forgot that this is only possible in the next release.  You will be able to use all the ActiveX controls in VB.NET when the next release come out.   I guess you will just have to wait, the next relese should be ready soon.



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