Re: MDI Child Forms -- Diffrent Behavior in new Framework
Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance
Justin, I had the same problem.
A solution that I found is pasted below
Dim frmBrowse As New Form1
Dim MDIClient As System.Windows.Forms.Control
MDIClient = ReturnMDIClient(frmMain)
frmBrowse.MdiParent = frmMain
frmBrowse.Left = 0 'MDIClient.Left
frmBrowse.Top = 0 'MDIClient.Top
frmBrowse.Width = MDIClient.ClientRectangle.Width
frmBrowse.Height = MDIClient.ClientRectangle.Height
Public Function ReturnMDIClient(ByVal frm As
System.Windows.Forms.Form) As Windows.Forms.Control
Dim c As Control
ReturnMDIClient = frm.Controls(0)
For Each c In frm.Controls
If TypeOf c Is MdiClient Then
ReturnMDIClient = c
End If
Next c
End Function
In VB6 it was so much easier but there were drawbacks. You had to define a
form as an MDIChild at design time and only one MDI per application. (Not
that I found a need for anymore.)
I would suggest that more code has to be written in vb.net 2005 for this
simple resizing than in old and no longer seriously supported VB6.
Let's hope that this is an exception.
Garry
PS - DockStyle shud be set to Manual for the frmBrowse. (I think)
"Justin Lazanowski" <justin@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:eJ4w0MoJGHA.2828@xxxxxxxxxxxxxxxxxxxxxxx
>
>
> I have an exsiting MDI application. I have the when the child is called
> from the Parent, I set it's DockStyle to fill, I also have the child form
> set to maximized
>
> In VS 2003 and 1.1 this works the way I want it to, the child form is
> maximized whithin the parent so that a title bar is not displayed nor is a
> window border, it looks like it's a panel in the parent form.
>
> In VS 2005 and 2.0 it will not draw this way, no matter what I set the
> window size property to, the child still draws as a window within the
> parent leaving a thin border where it's docked in the parent.
>
> Any idea what I need to do to make it function like the 1.1 version?
>
> Thanks,
> Justin
>
.
Relevant Pages
- RE: Parse Nested Elements to Single DataGrid
... 'Dim MasterTable As New DataTable ... Dim TableName, TableNameInner As String ... 'Save the next and last row values for this parent ... 'Get LoopRowNum for table where TableName is the key ... (microsoft.public.dotnet.xml) - RE: Re-run a Query Based on Previous Results
... Function fnProgenitor(Fsbill As String, ... Dim rs As DAO.Recordset ... The value for ID is the first Parent in Fsbill. ... (microsoft.public.access.queries) - RE: Re-run a Query Based on Previous Results
... Public Function fnProgenitor(TableName as String, ... Dim rs As DAO.Recordset ... Dim varParentID As Variant ... I have a function I use to determine the ROOT LEVEL parent (the ... (microsoft.public.access.queries) - Re: parent column in child row
... You can do what you want by adding a calculated column to the child ... DataTable that contains and expression that references a parent row column. ... Dim cn As SqlConnection = New SqlConnection ... (microsoft.public.dotnet.framework.adonet) - Re: parent column in child row
... You can do what you want by adding a calculated column to the child ... DataTable that contains and expression that references a parent row column. ... Dim cn As SqlConnection = New SqlConnection ... (microsoft.public.dotnet.languages.vb) |
|