|
-
Nov 3rd, 2006, 09:09 AM
#1
Thread Starter
Fanatic Member
[2005] MDI child area size
I want to use a MDI-form as a container for forms with no border. Therefore these forms must fit in the child area of the MDI-parent (without any appearing scrollbars). How to get this size?
-
Nov 3rd, 2006, 09:17 AM
#2
Re: [2005] MDI child area size
You could set their dockstyle to fill after instantiating them.
-
Nov 3rd, 2006, 09:18 AM
#3
Re: [2005] MDI child area size
Code:
Dim frm As Form
frm.MdiParent = me
frm.show()
frm.dockstyle = dockstyle.fill
-
Nov 3rd, 2006, 09:22 AM
#4
Re: [2005] MDI child area size
It sounds to me like you should be using a regular form and UserControls rather than an MDI interface. Would you care to elaborate on the scenario?
-
Nov 3rd, 2006, 09:30 AM
#5
Re: [2005] MDI child area size
JM, I have a similar application where I use an MDI container with a customer ToolBar. The balance of the MDI container is used to open Children without borders so the GUI looks more fluid (Just my opinion).
-
Nov 3rd, 2006, 09:31 AM
#6
Thread Starter
Fanatic Member
Re: [2005] MDI child area size
 Originally Posted by jmcilhinney
It sounds to me like you should be using a regular form and UserControls rather than an MDI interface. Would you care to elaborate on the scenario?
Well I want to encapsulate functionality in each form. Each form has a certain function.
-
Nov 3rd, 2006, 09:35 AM
#7
Re: [2005] MDI child area size
 Originally Posted by namrekka
Well I want to encapsulate functionality in each form. Each form has a certain function.
A UserControl can have a certain function just as easily as a form.
-
Nov 3rd, 2006, 09:36 AM
#8
Thread Starter
Fanatic Member
Re: [2005] MDI child area size
 Originally Posted by circuits2
You could set their dockstyle to fill after instantiating them.
This works, however what if I want 2 form next to each other (glued together)
-
Nov 3rd, 2006, 09:39 AM
#9
Thread Starter
Fanatic Member
Re: [2005] MDI child area size
 Originally Posted by jmcilhinney
A UserControl can have a certain function just as easily as a form.
The forms are containing to much code. I want to use the same style as I did before in VB6 app's.
-
Nov 3rd, 2006, 09:48 AM
#10
Re: [2005] MDI child area size
If forms have too much code, and you want more than one open, perhaps you need to use JM's idea and use a UserControl for each.
-
Nov 3rd, 2006, 09:53 AM
#11
Re: [2005] MDI child area size
 Originally Posted by namrekka
The forms are containing to much code. I want to use the same style as I did before in VB6 app's.
Forget VB6. This is VB.NET and it's not the same thing. If the situation is best served by UserControls then UserControls is what you should use. Of course, you can do whatever you want but doing something because its what you did in VB6 is just plain illogical. Why did you switch to VB.NET if you want to do things the VB6 way? You changed, I would imagine, because VB.NET offered advantages, but if you insist on doing things the way you used to then you're ignoring some of those advantages. If VB.NET offers a better way to do something then I'd suggest that you use it. For instance, two UserControls in a TableLayoutPanel will give you the side-by-side thing and maintain the relative dimensions even if the form is resized. With forms you'd have to do a lot more of the work manually. Fight progress if you want but I don't see the point.
-
Nov 3rd, 2006, 10:03 AM
#12
Thread Starter
Fanatic Member
Re: [2005] MDI child area size
Sorry jmcilhinney but what I mean with "the same style as I did before in VB6 app's" is how it looks like for the user.
What I mean with "The forms are containing to much code" is that they contain to much code for using it in a control and I don't want to reuse.
-
Nov 3rd, 2006, 11:36 AM
#13
Re: [2005] MDI child area size
If you used forms (or a UserControl), what would you be putting in it/them? How many different forms/UserControls do you have to choose from? Could you get away with using panels?
-
Nov 3rd, 2006, 12:25 PM
#14
Thread Starter
Fanatic Member
Re: [2005] MDI child area size
The current app I talk about had a total 40k lines of code divided over 45 forms and a ca 50 classes. This a app in VB6. Now a "sort of the same" application needs to be created in VS2005. I, and others, did like the appearance of the other application and for the new one I like to use the same style.
Could you get away with using panels?
Panels can be used. But can't encapsulate data. Perhaps I have to think it over.
-
Nov 3rd, 2006, 12:54 PM
#15
Re: [2005] MDI child area size
If you used forms before, then the easiest conversion or duplication is going to be using forms again. Especially when your application depends on events inside the forms. On the flip side, you still didn't answer the question of what is on the forms. Therefore, your answer to that question may lead you right back the JM's suggestion of using UserControls.
-
Nov 3rd, 2006, 03:51 PM
#16
Re: [2005] MDI child area size
 Originally Posted by namrekka
I want to use a MDI-form as a container for forms with no border. Therefore these forms must fit in the child area of the MDI-parent (without any appearing scrollbars). How to get this size?
From a child form, you can get its mdiparent clientsize. Use this info to set your child form's width and height.
VB Code:
MsgBox(Me.MdiParent.ClientSize.ToString)
-
Nov 6th, 2006, 05:43 AM
#17
Thread Starter
Fanatic Member
Re: [2005] MDI child area size
 Originally Posted by stanav
From a child form, you can get its mdiparent clientsize. Use this info to set your child form's width and height.
Thanks this info works!
-
Nov 6th, 2006, 05:54 AM
#18
Thread Starter
Fanatic Member
Re: [2005] MDI child area size
 Originally Posted by circuits2
you still didn't answer the question of what is on the forms
I don't see the reason to tell what is on the 45 forms. I told that forms are not used for reuse but only for encapsulating functionality. Each form is different from the other. 1 form for video capture. 1 form for interact and measuring the image, 1 form with profiles, etc. So what is the advantage of using a usercontrol then?
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
|