Print Page | Close Window

Using TabControl in a MDI child form

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2338
Printed Date: 22 June 2024 at 10:33pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Using TabControl in a MDI child form
Posted By: Ajornet
Subject: Using TabControl in a MDI child form
Date Posted: 08 June 2005 at 1:20am
Hello,
after many tries with my application and the TabManager example, I have found that I can't use the TabControl inside one of my forms of the MDI collection.

Is it true ?
Thanks
Daniel


-------------
Daniel



Replies:
Posted By: SuperMario
Date Posted: 08 June 2005 at 7:25am
Is the for you want to place it on the MDIParent form?  If so, try placing the tab control in a picturebox or panel control.  If this is not what you meant, then are you talking about placing the tabcontrol on the MDIChild form?  Do you use VB6, C#, VB.NET, etc?


Posted By: Ajornet
Date Posted: 08 June 2005 at 7:33am
I want to place my TabControl on a MDIChild form.

I use VB.NET.
I've read the post " forum_posts.asp?TID=2338&PN=1" target="_self" title="Hello,after many tries with my application and the TabManager example, I havefound that I can't use the TabControl inside one of my forms o... - Using TabControl in a MDI child form " and I've not understood the place for the PictureBox. It's not very clear.

Daniel


-------------
Daniel


Posted By: SuperMario
Date Posted: 08 June 2005 at 8:01am
Not sure what to tell you.  I just modified the TabManager Sample and it worked ok.  What problems are you having trying to do this?  I did not need a picture box, I simply placed the Tabcontol on the MDI Child form.


Posted By: Ajornet
Date Posted: 08 June 2005 at 8:09am
Can you send me the modified TabManager sample.

I will see where I'm wrong.

Thanks.


-------------
Daniel


Posted By: SuperMario
Date Posted: 08 June 2005 at 8:17am
OK, but keep in mind that I just cut and paste the code to create the tabs, so not all of the options work.  I just used the code to illustrate how to hadd the tabcontrol. uploads/SuperMario/2005-06-08_081710_TabManager.zip - 2005-06-08_081710_TabManager.zip


Posted By: Ajornet
Date Posted: 08 June 2005 at 9:53am
Thanks, but this doesn't work, the MDIChild doesn't  have tabs :

This the problem I get. I work in VB.net with VS2003

Daniel


-------------
Daniel


Posted By: SuperMario
Date Posted: 08 June 2005 at 10:10am
I uses 2002 and it worked OK.


Posted By: Ajornet
Date Posted: 08 June 2005 at 10:19am
Ok, but there is a big problem. This is a regression.

You see on the forum that I am not alone with this problem.

Help me with the panel, I don't see where I have to place one.

In your example, is it in the Usercontrols like pagAutoHidePanel or PageTabControl ?

And how do I replace this :
wndTabControl1.InsertItem(0, "TabWorkspace", pageTabWorkspace.Handle.ToInt32, 300) which handle do I need to use ?

Thanks for any help.
Daniel


-------------
Daniel


Posted By: SuperMario
Date Posted: 08 June 2005 at 12:22pm
I know this isn't the best way, but it works.  Maybe Oleg can suggest better way for .NET 2003.


uploads/SuperMario/2005-06-08_122243_TabManager.zip - 2005-06-08_122243_TabManager.zip


Posted By: Ajornet
Date Posted: 08 June 2005 at 2:15pm
I bought high level control not to program all these bad codes. Ihave to do as with the Microsoft's sstabs  !!!
And :
- I don't get the controls inside the different pages.
- If I open a second document, I get an error on  closing it or when I close the application
- It's a great job to have dynamically page inside the tab control

This product is good, why this feature doesn't work in VS2003 ?

I hope this will be corrected soon.

Daniel




-------------
Daniel


Posted By: SuperMario
Date Posted: 08 June 2005 at 2:17pm
Wait for Oleg, I think he will know better solution


Posted By: Ajornet
Date Posted: 08 June 2005 at 2:25pm
OK, but I work on this problem for 2 days before posting here.

And it becomes urgent for me because I can't work on my application.

Daniel


-------------
Daniel


Posted By: SuperMario
Date Posted: 08 June 2005 at 2:27pm
I will send Oleg an email and see that he looks at this


Posted By: Oleg
Date Posted: 09 June 2005 at 1:56am

There are simple steps:

1. create MDI application, put TabControl on frmDocument

2. Put Panel1, Panel2 on the frmDocumnet (future tabs) add some controls on them.

3. add this member:

Sub CreateTabs()

Me.Controls.Remove(Panel1)

wndTabControl1.Controls.Add(Panel1)

wndTabControl1.InsertItem(0, "TabWorkspace", Panel1.Handle.ToInt32, 300)

Me.Controls.Remove(Panel2)

wndTabControl1.Controls.Add(Panel2)

wndTabControl1.InsertItem(1, "TabControl", Panel2.Handle.ToInt32, 300)

End Sub

4. _after you create documnet_ call its CreateTabs member:

 

Sub LoadNewDoc()

Dim frmDocument As frmDocument = New frmDocument()

frmDocument.MdiParent = Me

frmDocument.Show()

frmDocument.CreateTabs()

End Sub



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Ajornet
Date Posted: 09 June 2005 at 2:53am
Hello,

it's really better to use.

It remains a bug with this solution, if we open a second (or more) document the tabs of the first document disappear. It's the same if we resize the window. This in the case of TabControl is marked as 'Fill' in it's dock property. If it is not marked as fill all seem to be good.

But if we do like this :
- open a document
- click another tab than the first
- open another document
- the tabs of the first don't disappear

Stange, isn't it ?

I will try to click programmatically.

Daniel




-------------
Daniel


Posted By: Oleg
Date Posted: 09 June 2005 at 4:26am

I can't reproduce it, may be you set some another options.... May be you can attach your project/new simple application to show this bug?



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Ajornet
Date Posted: 09 June 2005 at 7:54am
Hello,

I modify the http://www.ajornet.com/tabmanager.zip - tabmanager project a little.

I have two panels the first with a grid (MSExcel) and the second with a chart (MSChart).

The problem arises when dock property is set to "fill" for all the components : the tab, the two panels, the grid and the chart.

Create some docs, play with there, click the tabs, click the document and not after a long time tabs disappear.


PS : In reality, I will use TeeChart and a grid in tests.


-------------
Daniel


Posted By: Ajornet
Date Posted: 09 June 2005 at 11:10am
Hello,

it seems that if I set the dock property :
- to 'Fill' for the tabControl and for my components inside the panels
- and to 'None' for the panels it's work perfectly

So I get exactly what I want since the beginning.

I want to thank you for your help and your patience.




-------------
Daniel



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net