MDI Parent not showing form controls for child


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have some dll's with forms which are shown on a menu click in my MDI Parent form.  I have IsMdiContainer=True on the parent, and IsChildForm=True on the child.  I have MaximizeBox=True and MinimizeBox=True for both parent and child.  When I show the child form everything is fine unless I maximize it.  It maximizes within the parent, but I lose my form controls for minimize, restore, and closing the form.  These should show up somewhere shouldn't they?  I don't have a menu bar on the parent, is this the issue?  And if so, can I get around it?  Right now, I can't maximize forms unless I want them to always be maximized...and also, if I click on the parent Close X and a child form is showing, it will the child form on top instead of closing the entire parent.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You don't want to use the IsChildForm property... that's a StrataFrame property that's used for the ChildFormDialog.  What you want to do is set the MdiParent property on the child form to an instance of the MDI parent form.  Then, when you maximize, you should be able to see both sets of control boxes (minimize, maximize, and close).  I've tested it, and you should still see both sets of control boxes even without a menu.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have the IsChild property setto False now and it didn't make any difference.  I was already setting the MdiParent to the parent form.  The code I'm using is something like the following:

Private Sub ShowTable(ByVal Type As TableType)
 
Dim TableForm As MicroFour.StrataFrame.UI.Windows.Forms.StandardForm|
  
Select Case Type
    ....
    Case TableType.SomeType : TableForm = frmSomeForm.GetInstance
    ....
  End Select

  If TableForm IsNot Nothing Then
    TableForm.MdiParent = Me
   
TableForm.Show()
   
Me.ActivateMdiChild(TableForm)
 
End If

End Sub

 

GetInstance is a method that returns the unique instance of the form, so that only one is shown at a time.  Something like this:

Public Class frmSomeForm

 
Shared UniqueInstance As frmSomeForm
 
 
Shared Function GetInstance() As frmSomeForm
   
If UniqueInstance Is Nothing Then UniqueInstance = New frmSomeForm
   
Return UniqueInstance
 
End Function

End Class


StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
I'm not sure what is happening, then.  I created a new project, set Form1.IsMdiContainer = True, added another form (Form2) and created a new instance of Form2 as a child of Form1 within Form1.Load.  When I maximized Form2, I got the second screen shot.
Attachments
Mdi1.png (168 views, 7.00 KB)
Mdi2.png (160 views, 5.00 KB)
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Oh, and this was the code in Form1:

Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim loForm As New Form2()
        loForm.Show()
        loForm.MdiParent =
Me
        Me.ActivateMdiChild(loForm)
    End Sub
End
Class


StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
And I tried it by setting the MdiParent property on Form2 before showing it and got the same results.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I am trying to create a small test project, and am now getting an error message which I am attaching.  I created a StrataFrame Windows App, and then when I tried to add an SF DevEx Standard Form as a new item, I get the error message.  Not sure where this is coming from...any ideas?
Attachments
error.PNG (158 views, 37.00 KB)
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I figured out the problem.  When I add a BarManager object from DevExpress it makes my control box disappear for maximized child forms.  Not sure, but it looks like a DevExpress bug.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Yes, I can see that... the BarManager has it's own set of "rules" that it lives by.  You might be able to set the padding on it, or something like that.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search