|
-
Oct 30th, 2007, 12:19 PM
#1
Thread Starter
Fanatic Member
-
Oct 30th, 2007, 12:44 PM
#2
Re: [2005] form not opening right
The form is maximizing.... the panel is not.... try making sure your panel is set to Dock = Fill... or anchor it to all sides (I'd go with dock=fill).
As for the other error, with out knowing what code is running, can't help you. But it sounds like you're tryign to clear out an Icon for an object (presumably the form) after it's been disposed of.
-tg
-
Oct 30th, 2007, 12:46 PM
#3
Re: [2005] form not opening right
I assume you have tried rebuilding your solution and closing and reopening the form designer window?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 30th, 2007, 01:22 PM
#4
Thread Starter
Fanatic Member
Re: [2005] form not opening right
I don't have a panel on the form.
The code I am trying to run is
vb Code:
For Each frms As Form In Me.MdiChildren
frms.Close()
Next
Using Visual Studio 2008
Please mark your thread RESOLVED if you no longer need help.
-
Oct 30th, 2007, 01:31 PM
#5
Re: [2005] form not opening right
did you add this menustrip1 to the MDI parent or the MDI child form?
as for your dispose error try this:
Code:
For Each frms As Form In Me.MdiChildren
if not frms.IsDisposed then
frms.close
end if
Next
-
Oct 30th, 2007, 01:37 PM
#6
Thread Starter
Fanatic Member
Re: [2005] form not opening right
It is on the MDI Parent and no menustrip is specified for the rest of the child forms.
I will try your code, thanks!
Using Visual Studio 2008
Please mark your thread RESOLVED if you no longer need help.
-
Oct 30th, 2007, 01:46 PM
#7
Re: [2005] form not opening right
I don't really have a reason why it is happening, but it appears to be some sort of bug.
How I was able to get it to work though, was to NOT set the child forms windowstate to maximized at design time (leave it as normal) but then when you actually create an instance and show the form, set it to maximized in code before showing it..
IE in the MDI parent:
Code:
Dim F As New frmChild
F.MdiParent = Me
F.WindowState = FormWindowState.Maximized
F.Show()
-
Oct 30th, 2007, 01:47 PM
#8
Thread Starter
Fanatic Member
Re: [2005] form not opening right
ok, i will try that and see how it works for me. thanks a bunch!
Using Visual Studio 2008
Please mark your thread RESOLVED if you no longer need help.
-
Oct 30th, 2007, 03:56 PM
#9
Thread Starter
Fanatic Member
Re: [2005] form not opening right
 Originally Posted by kleinma
did you add this menustrip1 to the MDI parent or the MDI child form?
as for your dispose error try this:
Code:
For Each frms As Form In Me.MdiChildren
if not frms.IsDisposed then
frms.close
end if
Next
That didn't work, I still get the same error message.
Using Visual Studio 2008
Please mark your thread RESOLVED if you no longer need help.
-
Oct 30th, 2007, 04:01 PM
#10
Thread Starter
Fanatic Member
Re: [2005] form not opening right
 Originally Posted by kleinma
I don't really have a reason why it is happening, but it appears to be some sort of bug.
How I was able to get it to work though, was to NOT set the child forms windowstate to maximized at design time (leave it as normal) but then when you actually create an instance and show the form, set it to maximized in code before showing it..
IE in the MDI parent:
Code:
Dim F As New frmChild
F.MdiParent = Me
F.WindowState = FormWindowState.Maximized
F.Show()
I did the exact same thing but the form just flickers multiple times and never opens.
Using Visual Studio 2008
Please mark your thread RESOLVED if you no longer need help.
-
Oct 30th, 2007, 04:06 PM
#11
Re: [2005] form not opening right
This may sound stupid... but I'm going to ask anyways.... what's the border style for the form?
-tg
-
Oct 30th, 2007, 04:09 PM
#12
Thread Starter
Fanatic Member
Re: [2005] form not opening right
It's sizable. I'm going to kick myself if this is what is causing the error!
Using Visual Studio 2008
Please mark your thread RESOLVED if you no longer need help.
-
Oct 30th, 2007, 04:18 PM
#13
Thread Starter
Fanatic Member
Re: [2005] form not opening right
I changed it to Fixed single and it is working fine now but for some reason, when I added the mainmenustrip to the mdi parent, i can't close the child forms. It gets stuck on this:
[highlight = vb]
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing) 'gets stuck here when trying to close
End Sub
[/highlight]
Using Visual Studio 2008
Please mark your thread RESOLVED if you no longer need help.
-
Oct 30th, 2007, 04:48 PM
#14
Re: [2005] form not opening right
Interesting... I would have expected that to be the other way around... at least that part is solved.
As for the dispose problem.... don't know... .I don't normaly add the dispose code to my forms, so that's a little out of my element.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|