![]() |
Workspace w/ Max MDI child fails |
Post Reply ![]() |
Author | |
markmbaker ![]() Newbie ![]() Joined: 14 May 2004 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() 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?
|
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
CommandBars(1).SetFlags xtpFlagHideMDIButtons, xtpFlagHideClose
|
|
![]() |
|
nighthawk ![]() Senior Member ![]() ![]() Joined: 11 June 2004 Status: Offline Points: 167 |
![]() ![]() ![]() ![]() ![]() |
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?
|
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
|
nighthawk ![]() Senior Member ![]() ![]() Joined: 11 June 2004 Status: Offline Points: 167 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
Where in your code are you hidding the buttons? Maybe you can post a sample? That same code is working fine for me.
|
|
![]() |
|
nighthawk ![]() Senior Member ![]() ![]() Joined: 11 June 2004 Status: Offline Points: 167 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
That looks correct. Attach a sample project so I can debug.
|
|
![]() |
|
nighthawk ![]() Senior Member ![]() ![]() Joined: 11 June 2004 Status: Offline Points: 167 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
ccalhoun ![]() Newbie ![]() Joined: 29 June 2004 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
What commandbar is being used for this example? |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
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?" ? |
|
![]() |
|
ccalhoun ![]() Newbie ![]() Joined: 29 June 2004 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
Is this set flag functionality exposed for toolbar controls? If not how can you accomplish this independently of the CommandBars or the navigation mechanism? |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
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? |
|
![]() |
|
ccalhoun ![]() Newbie ![]() Joined: 29 June 2004 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
I would like to accomplish removing the minimize, maximize and close buttons from child forms when they are opened. Any ideas? |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
CommandBars(1).SetFlags xtpFlagHideMDIButtons, 0
|
|
![]() |
|
ccalhoun ![]() Newbie ![]() Joined: 29 June 2004 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
What if the MDI child form is open from a toolbar click event?
|
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
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?
|
|
![]() |
|
ccalhoun ![]() Newbie ![]() Joined: 29 June 2004 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
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) Which object that I am using will expose setflags?
|
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
ccalhoun ![]() Newbie ![]() Joined: 29 June 2004 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
No I am not I am just using windows controls.2004-06-29_102047_MDITest.zip
|
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
That code will only work with the Codejcok CommandBars control. Why are you not using the Codejock CommandBar?
|
|
![]() |
|
ccalhoun ![]() Newbie ![]() Joined: 29 June 2004 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
How could I from within VB.NET. I downloaded the Toolkit but I don't see any assemblies that could be referenced from .NET
|
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |