0

For instance, I have an application that has a main window and then child windows inside of it. http://screenshots.rd.to/sn/e3hek/sapienfullwindow.png http://screenshots.rd.to/sn/e3hek/appscreen8.png What i need is to grab each individual child window of that application, and display them as tabs in my application, or on a panel's handle.

I already have code to kidnap the application and put it into mine, and it works great.

E3pO
  • 1
  • 2
  • 1
    that is not a "tab", but a MDI application. – serhio Jan 04 '10 at 11:09
  • Please clarify : Is your app WinForms MDI ? – BillW Jan 04 '10 at 11:35
  • 1
    Thank you Kavitesh Singh, i'll try the DockPanelSuite later today when i get home from work. If this clears anything up at all, i'm trying to load up an application (Process p = Process.Start(CEROOT + "sapien.exe");) Then set the parent to my tabcontrol (Or DockPanel), and then the child windows of the loaded application "sapien.exe" i want to grab and put into their own tabs(or dockpanels). Thanks to all. – E3pO Jan 04 '10 at 12:14
  • @E3pO fyi it is very easy to insert an instance of a Form into one of the TabPages of the WinForms TabControl : let's say you have an instance of a Form named 'F2 you want to go into the first TabPage in your application Form's TabControll : set the 'TopLevel property of the Form 'F2 to 'false, then all you have to do is something like : tabControl1.TabPages[0].Controls.Add(F2); ... note that you may want to Dock the Form or position it, or anchor it, within its TabPage container to achieve the "look and feel" you want. Good luck, – BillW Jan 04 '10 at 12:27
  • @E3pO if you are at an "entry level" in .NET, you may wish to consider/evaluate if the "investment" in learning to program to DockPanelSuite (I'm sure it's a fine library) will "in the long run," depending on your goals as a programmer, be most useful to you. Of course, I'm not 'psychic': you may just want a "quick fix" for a real-world problem here. Take this "advice" with a "grain of salt." I've written programs in WinForms (not MDI) that exploded each TabControl page into a separate Form, and that allowed you to then "implode" them all back into a TabControl again : learned a lot that way. – BillW Jan 04 '10 at 12:43
  • @E3pO: you would see that dockpanel is widely used in making docking applications. I example is opensource Visual studio C# clone known and Sharpdev(http://www.icsharpcode.net/OpenSource/SD/) use this library extensively for GUI frontend. Like BillW said you learn but experimenting.. So would suggest give both a shot provided you have time before the deadline. – K Singh Jan 04 '10 at 15:49

1 Answers1

0

MDI support is already present in the C#. So the first screenshot is using the MDI option.

The second screenshot is using tabbed windows. Now you have two options:

  1. Use this opensource library DockPanelSuite which will let you have tabs in your application. something similar to visual studio interface. You can create forms and then tab it based on your needs. You can even dock them anywhere in the parent form by drag and drop. Just like in visual studio.
  2. The second option is to create a form with tab control covering the whole windows. There you create tabs using the resource editor and hide/show based on the forms you want to display to the end user.

In my opinion, use the first option which gives you lot more customization. Also if you use the dockpanel, you can switch between the views shown in your first screenshot and second one. So user has better control as to how he wants to view. Dockpanel is free to use even in commerical apps and comes with source code. So you can either use the dll or directly incorporate the code in your application.

K Singh
  • 1,710
  • 1
  • 17
  • 32
  • @Kavitesh, I could replicate the look and feel of both those screen shots in a WinForms app that was not MDI, using standard MenuStrip and TabControl for the second screen. I've asked OP to clarify. – BillW Jan 04 '10 at 11:36
  • @BillW: I mentioned it in point 2 incase he would like to use the tabcontrol for having such a look. I have just provided him with two options and he can choose either of them. Using dockpanel, you can have side panels like we have in visual studio's solution explorer or properties. Its something he may require at some later point. If you using tabcontrol then surely you would not need MDI. His first screen shows the MDI type application though. So keeping that in mind i gave the first option. – K Singh Jan 04 '10 at 11:47
  • @Kavitesh, no criticism of your answer was intended. Sukria, (and, if my intuition is correct : "Sat Sri Akal"). – BillW Jan 04 '10 at 12:22
  • @BillW: "Sat Sri Akal" - I am with you here :) Any acquaintance to an indian or its movies :)?? – K Singh Jan 04 '10 at 13:03