 |
|
 |
Hi Serdar,
I came across your post during work. I'm currently in the UK but would like to work in Turkey for a Turkish development company hopefully.
C# .NET developer (senior) 10 yrs + experience C++, C, ASM
Can you give any advice for me?
Thank You.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
It's a good article, it works very well for me, except one issue. When I click a tab page to change the child form, there will be showed some normal size child forms and repidly disappair, but when I use CTRL + TAB key to change child form, there's nothing happends something like that. So is there anyone have better idea?
Thanks and regards. Jason.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Excellent and concise article! I gave it a 5 even though I found one small issue...
I found that if you used the Window menu to select a different mdi child window or if you did so using code anywhere in the app then even though the correct child appeared, the tab stayed where it was.
To fix it I added a little code to the MainWindow_MdiChildActivate method.
Add an else to the "if( this.ActiveMdiChild.Tag == null )" statement: else { TabPage tp = this.ActiveMdiChild.Tag as TabPage; if( tp != null ) c_MDITabs.SelectedTab = tp; }
That way anytime an mdi child is activated, the correct tab is selected.
BTW, someone below was having problem getting the windows to be in tabs. I believe they probably forgot to set the MDIParent property of the windows when they created them, so they are just normal child windows.
|
| Sign In·View Thread·PermaLink | 4.00/5 (4 votes) |
|
|
|
 |
|
 |
_ How can I hide the (¿menustrip?) that is showed with _ |_|X controls at right when the mdi child forms are minimized and don't exist a main menu strip? good and simple control! thanks!
Fabian Silva
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
this code is really useful,
I'm trying to make a program that requires tabbed forms, but the problem is, when i make a change at one instance it changes all the forms.
for example when i change the font at one, the font is change at all the other forms. Any idea how to deal with that?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I put a PANEL to mainForm for child forms.
And set child form properties childForm.FormBorderStyle = FormBorderStyle.None; childForm.ControlBox = false; childForm.StartPosition = FormStartPosition.Manual; childForm.WindowState = FormWindowState.Normal; childForm.Parent = PANEL
And set child form position to centered of panel.
And in the MainForm_SizeChanged events setup child forms positions.
Now, I have no flicker problem.
And I write own tab control like IE.7 with close button on active tabs.
----------------- Serdar YILMAZ Senior Developer
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Serdar,
I'm interesting in the custom tab control with the close button on it. Is that also available? Does it somehow get rid of the close button that appears at the end of the menu?
Scott
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Ok. I'm so busy nowadays. I will send my tabControl your e-mail address.
now, mytabControl like Internet Explorer 7. (same apperance, same close button)
----------------- Serdar YILMAZ Senior Developer
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Serdar,
I know all about busy ... But when you get a chance, just click the email link instead of the reply link to send it to me.
Thanks, Scott
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi Serdar, Thanks for this code, it was just what I needed for my project and it works great!
I'm really interested in your IE7 tab control update with the close button on the active tab. Can you either post it here or send it to me?
Thanks! 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I have tried so many things and your code seemed like my Jackpot! BUT IT Doesnt work! Atleast not the way I expected it to- I have a menustrip with
File->Create->1. LC 2. Guarantee Both these options should open as seperate tabs - not Forms but Tabs-just like IE7.
Now these are the steps I have done(by the way am using c#) :
1. Create main Form 2. Insert the menustrip and the menuItems 3. Insert the Tabcontrol-set the dock to top, Visible setting to False and deleted Both the TabPages. Named it tabForms. 4. Inserted the code in this article to my main Form as appropriate. Both my other forms do not have tab pages but I tried putting them in just to see if that would work. I have the menuItem click code done too.
My forms do open and the functionality works but the tab functionality doesnt show up!! What am I doing wrong! I'm finding this for 4 days and my manager must be losing his patience now! Please Help! *****See Code Below:
private void Form1_MdiChildActivate(object sender, EventArgs e) { if (this.ActiveMdiChild == null) tabForms.Visible = false; // If no any child form, hide tabControl else { this.ActiveMdiChild.WindowState = FormWindowState.Maximized; // Child form always maximized
// If child form is new and no has tabPage, // create new tabPage if (this.ActiveMdiChild.Tag == null) { // Add a tabPage to tabControl with child // form caption TabPage tp = new TabPage(this.ActiveMdiChild.Text); tp.Tag = this.ActiveMdiChild; tp.Parent = tabForms; tabForms.SelectedTab = tp;
this.ActiveMdiChild.Tag = tp; this.ActiveMdiChild.FormClosed += new FormClosedEventHandler(ActiveMdiChild_FormClosed); } if (!tabForms.Visible) tabForms.Visible = true; } }
private void ActiveMdiChild_FormClosed(object sender, FormClosedEventArgs e) { ((sender as Form).Tag as TabPage).Dispose(); }
private void tabForms_SelectedIndexChanged(object sender, EventArgs e) { if ((tabForms.SelectedTab != null) && (tabForms.SelectedTab.Tag != null)) (tabForms.SelectedTab.Tag as Form).Select(); } private void freetextToolStripMenuItem_Click(object sender, EventArgs e) { CreateLC newMDIChild = new CreateLC(); // Set the Parent Form of the Child window. newMDIChild.MdiParent = this; // Display the new form. newMDIChild.Show(); }
public void SetMDIList() { Form activeChild = this.ActiveMdiChild; // Create the MenuItem to be used to display an MDI list.
MenuItem freetextToolStripMenuItem = new MenuItem(); MenuItem createToolStripMenuItem = new MenuItem(); // Set this menu item to be used as an MDI list createToolStripMenuItem.MdiList = true; freetextToolStripMenuItem.MdiList = true; } private void guaranteeToolStripMenuItem1_Click(object sender, EventArgs e) { CreateGuarantee newMDIChild = new CreateGuarantee(); // Set the Parent Form of the Child window. newMDIChild.MdiParent = this; // Display the new form newMDIChild.Show(); }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I don't know what is the problem. Review "tabForms_SelectedIndexChanged" procedure.
Or send me sample code.
----------------- Serdar YILMAZ Senior Developer
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |