Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Using TabControl in a MDI child form
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Using TabControl in a MDI child form

 Post Reply Post Reply
Author
Message
Ajornet View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: France
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ajornet Quote  Post ReplyReply Direct Link To This Post Topic: Using TabControl in a MDI child form
    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


Edited by Ajornet
Daniel
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Ajornet View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: France
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ajornet Quote  Post ReplyReply Direct Link To This Post 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 "Using TabControl in a MDI child form" and I've not understood the place for the PictureBox. It's not very clear.

Daniel
Daniel
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Ajornet View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: France
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ajornet Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2005 at 8:09am
Can you send me the modified TabManager sample.

I will see where I'm wrong.

Thanks.
Daniel
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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. 2005-06-08_081710_TabManager.zip
Back to Top
Ajornet View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: France
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ajornet Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2005 at 10:10am
I uses 2002 and it worked OK.
Back to Top
Ajornet View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: France
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ajornet Quote  Post ReplyReply Direct Link To This Post 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


Edited by Ajornet
Daniel
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.


2005-06-08_122243_TabManager.zip
Back to Top
Ajornet View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: France
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ajornet Quote  Post ReplyReply Direct Link To This Post 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




Edited by Ajornet
Daniel
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2005 at 2:17pm
Wait for Oleg, I think he will know better solution
Back to Top
Ajornet View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: France
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ajornet Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2005 at 2:27pm
I will send Oleg an email and see that he looks at this
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Ajornet View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: France
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ajornet Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Ajornet View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: France
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ajornet Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2005 at 7:54am
Hello,

I modify the 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
Back to Top
Ajornet View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: France
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ajornet Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.