Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 07:51

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



C# array of tabControls, creating new tabs by template

Discussion on C# array of tabControls, creating new tabs by template within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
Buckyx's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 177
Received Thanks: 2
C# array of tabControls, creating new tabs by template

EDIT: I found a way to do that, anyone willing to check my code If it can be better or contains any mistakes




Code:
for (int i = 0; i < l_Controller.Player.VillageCount; i++)
            {              
                m_pageVillage.Add(new TabPage(l_Controller.Player.Villages[i].Name + " (" + l_Controller.Player.Villages[i].X.ToString() + "|" + l_Controller.Player.Villages[i].Y.ToString() + ")"));
                l_BuildingTab.TabPages.Add(m_pageVillage[i]);

                m_Build.Add(new TabControl());
                m_pageVillage[i].Controls.Add(m_Build[i]);
                m_Build[i].Size = new Size(500, 250);

                m_pageRes.Add(new TabPage("Resources"));
                m_pageBul.Add(new TabPage("Buildings"));

                m_Build[i].TabPages.Add(m_pageRes[i]);
                pageRes[i].Padding = new System.Windows.Forms.Padding(3);
                m_Build[i].TabPages.Add(m_pageBul[i]);
                pageBul[i].Padding = new System.Windows.Forms.Padding(3);

                pageBul[i].UseVisualStyleBackColor = true;
                pageRes[i].UseVisualStyleBackColor = true;

                x = 0;
                y = 0;

                for (int j = 0; j < 18; j++)
                {
                    m_Res.Add(new Label());
                    m_pageRes[i].Controls.Add(m_Res[i * 18 + j]);

                    if (j % 3 == 0)
                    {
                        x = 0;
                        y = y + 20;
                    }
                    else
                        x = x + 100;

                    m_Res[i * 18 + j].Location = new Point(x, y);
                }
            }
Buckyx is offline  
Reply


Similar Threads Similar Threads
[Selling] Intro-Creating Service by Template™
05/18/2013 - Trading - 19 Replies
Hallo epvp, hiermit biete ich euch an, ein Intro für euch zu erstellen. Folgende Intros sind zur Zeit vorhanden: 1. GleichFinlay´s Intro- Like ? - YouTube 2. iTzSyruzLP´s Intro - YouTube
Creating an ebay template
06/11/2012 - General Coding - 1 Replies
Hi, First of all i dont know if i posted on the correct section but im looking to hire someone to custom make me an ebay template, i dont think its very complicated what i wish but it must look very stilysh and exactly as i order it, i got all the ideeas on my head just need someone to put them in practice. If someone can help me, ofc i will pay for this, msg me on [email protected] Danke :)



All times are GMT +1. The time now is 07:52.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.