Can't able to access the duplicate control?

I have created the duplicate control in tabpage as shown in below code snippet. but i can't able to access the created object.
Code Snippet
 private void button1_Click(object sender, EventArgs e)
            TabPage newPage = new TabPage();
            foreach (Control c in  tabControl1.TabPages[0].Controls)
                Control cNew = (Control)Activator.CreateInstance(c.GetType());
                PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(c);
                foreach (PropertyDescriptor entry in pdc)
                    object val = entry.GetValue(c);
                    entry.SetValue(cNew, val);
                newPage.Controls.Add(cNew);
            tabControl1.TabPages.Add(newPage);

Hi Carl,
Thanks for your update.
Now I got some idea. But I have one more issue. 
During button click the I need all the properties in textbox in TabPage1 to the textbox in NewTabPage(refer above image). but later if we change in text in any textbox the replaced text should not reflects the other text.
E.g: If textbox.text="Microsoft";
during buttonclick i need the textbox in New Tab Page should be Microsoft. 
later if I edit the text should not New Tab Page or TabPage1 the text should not reflects from one control to other.
Regards,
R.Senthil Kumaran
Hello,
I could get what you are dealing with now, and to get that done, I would recommend you use the following way.
1. Add properties to UserControl, you could define the names of these properties with custom rules.
public partial class UserControl1 : UserControl
public UserControl1()
InitializeComponent();
public string StrTxtBox1
get { return this.textBox1.Text ; }
set { this.textBox1.Text = value; }
2. Use similar way you shared and edit it to just copy the specific properties.
TabPage newPage = new TabPage("NewTabPage");
newPage.UseVisualStyleBackColor = tabControl1.TabPages[0].UseVisualStyleBackColor;
foreach (Control c in tabControl1.TabPages[0].Controls)
Control cNew = (Control)Activator.CreateInstance(c.GetType());
PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(c);
foreach (PropertyDescriptor entry in pdc)
if (entry.DisplayName == "StrTxtBox1"|| entry.DisplayName == "Location")
object val = entry.GetValue(c);
entry.SetValue(cNew, val);
newPage.Controls.Add(cNew);
tabControl1.TabPages.Add(newPage);
In this case, if we have a lot perproties to copy, you could consider capture them by the custom rules you defined at #1 like this one.
if (entry.DisplayName.Contains("StrTxt")|| entry.DisplayName == "Location")
object val = entry.GetValue(c);
entry.SetValue(cNew, val);
Result:
And if possible, you could consider using this way which just copies the Text , Location or any other property and we don't need to create any usercontrol.
TabPage newPage = new TabPage("NewTabPage");
newPage.UseVisualStyleBackColor = tabControl1.TabPages[0].UseVisualStyleBackColor;
foreach (Control c in tabControl1.TabPages[0].Controls)
Control cNew = (Control)Activator.CreateInstance(c.GetType());
PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(c);
foreach (PropertyDescriptor entry in pdc)
if (entry.DisplayName == "Text" || entry.DisplayName == "Location")
object val = entry.GetValue(c);
entry.SetValue(cNew, val);
newPage.Controls.Add(cNew);
tabControl1.TabPages.Add(newPage);
Regards.
Carl
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Can't able to access the Jar files which is kept inside the folder.

    Hi,
    I am using the eclipse IDE, my project folder contains the folders src, bin, .metadata, .settings
    if i place the jar file in the same location of the above mentioned folder means i can able to use the Jar file in eclipse(in my project).
    But i create one folder in the same location in the name of Jar or anything and all jar files are placed inside the folder,then i can't able to access the jar file in eclipse(in my project).
    How i can solve this problem?

    RajivGuna wrote:
    ..How i can solve this problem?Put Eclipse aside for the moment and learn how the SDK tools work at the level of the command line, then you will be much better placed to figure how to do it in the IDE. If you are still having problems, I suggest you ask on an [Eclipse forum|http://www.eclipse.org/forums/].

  • I can't able to access the itunes stores to download and update new apps

    iam using iphone4 for more than a six months. but for the last 10days i can't able to access the itunes store to download a app or to update it. what should i do. my itunes is opening properly. i can download videos pictures and songs from my system. the problem is only with itunes stores. i also updated the account information. which also doesnt got solved the problem. what should i do??

    http://support.apple.com/kb/TS1559

  • Not able to access the mx.controls package

    hi,
    i found a weird issue. I'm developing my application
    entirely using actionscript 3 by creating "actionscript Project' in
    the flex builder. I need to use the ColorPicker component which is
    under mx.controls package, but to my disappointment i'm not able to
    access that mx.controls package and when i forcefully use it the
    compiler throws me an error, but when i create a new flex project
    and create an asctionscript file, i'm able to access that
    mx.controls package and also the ColorPicker class. Can anyone tell
    me what the problem is?
    Thanks,
    Shajahan

    I am having the same issue. I'm using Flex 3 and I cannot
    access the mx.controls package in any actionscript project.

  • Can't able to Access the internet in my Windows server 2008

     I installed windows server 2008 server in my machine, it has only windows sever 2008 single OS.
           Now my problem is, i am not able to Access internet, I tried some intel softwares, to install Ethernet drivers, but no use.
    What i have to do now..? 
                                                       Please help in this issue,
                             Thanks in advance                              
                    surendra mannem
     

    Hi,
    Please confirm you have configured the correct TCP IP address, if you have the static IP address please confirm your default gateway and the DNS server address 
    is correct and work properly.
    More third party information:
    Windows 7 Static IP
    http://blog.mclaughlinsoftware.com/2009/11/26/windows-7-static-ip/
    How to Set Static IP Address in Windows 7
    http://www.youtube.com/watch?v=wmYBBHvfpTg
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Can't able to access the internet in window server 2003 sp2 64bit.

    Hi,
         recently i installed , windows server 2003sp2 64bit, every thing was perfect expect, internet.
    Ican't access the internet in that server, i tried to update the LAN drives but no use, I tired t install Adapter drives no use.
    What i have to do now,
    Thanks in advance,
    Surnedra Mannem.

    Hi
    Is this server in a domain or stand alone?
    Are you plugging the server direct in to the Internet Router or via Switches?
    What is the status of the Network Adapter Connected, Disconnected or Limited?
    Could you please tell us what is the IP address you are getting on the server?
    Try turning off the firewall also what browser are you using to access the internet on the server.
    Thanks

  • Only IE is able to access the internet; no other applications can access internet

    I recently upgraded my original Hitachi 160GB hard drive on my Lenovo IdeaPad Y510 to a WD 320GB hard drive, and cloned my original hard drive image to the new hard drive using Acronis True Image WD Edition's Disc Cloning utility. I had the utility resize the original partitions proportionally. Everything else seems to have transferred correctly to my new hard drive, but I find that ONLY Internet Explorer is able to access the internet, although I can ping my network printer, the other computers on my home wireless network, and even other IP addresses on the internet such as www.google.com, etc.
    I had removed my previous ZoneAlarm Free Firewall before doing the hard drive upgrade; it appears to have been conflicting with my Mozilla Firefox and Thunderbird applications, causing them to hang up and then not close down properly. I am currently using only the Windows Firewall and Windows Defender, along with AVG 9.0.814 Free Antivirus, SpyBot S&D 1.6.2.0 and Spywareblaster 4.3. I also used to use AdAware Free Edition, but had to uninstall it as I have not been able to update it to the newest version successfully.
    Is there something in the Windows Vista Home Premium OS I have on my machine that might be causing this problem? It is funny that ONLY Internet Explorer is able to access the internet now.

    Yes I do, and even with them checked to allow access (i.e., as an exception), it does not help.  I have tried all of the MS help about the problem, but they refer me to my machine's manufacturer for support, since my copy of Windows Vista came with it.  I cannot even use my DVD NeXtCopy software, as it requires access to the internet too, and even after re-installing it, I cannot activate the new installation because it cannot access the activation server!
    I hope someone can help me.  Upgrading to this new hard drive should not be so disastrous!
    Regards and thanks for trying to help!
    Ray
    vijaysaradhi wrote:
    You are using multiple number of malware removal tools on your system.I would recommend you to go for Microsoft security essentials Its Light on the system resources .Or use any one only...more than one will create false positive messages to come up 
    Next go to control panel-->system and security--> windows firewall-->allowed programs
    Do you see Firefox and the other browsers  in the list of allowed programs? something like this 

  • I only show one iCloud on my IPhone that can do a restore. I synced it with my MacBook Pro and I think that may have messed things up. Prior to that I have several backups. Will a "genius" be able to access the info I need?

    I only show one iCloud on my IPhone that can do a restore. I synced it with my MacBook Pro and I think that may have messed things up. Prior to that I have several backups. Will a "genius" be able to access the info I need?

    If things seem to be going haywire with your phone, it seems that it MAY be a software issue.
    Now, that being said, that does not necessarily mean that it is a virus. Software issues do happen sometimes. It is probably just coincidence.
    What you need to do is restore the device using iTunes. This will fix any software issues. After you have done this, you can restore from an iCloud backup.
    iCloud does not back up the actual software, so no, the "virus" would not have gotten into the backups.
    The link below provides steps on restoring your device using iTunes as well as how to restore from an iCloud backup.
    http://support.apple.com/kb/ht1766
    Don't worry! Everything should be back to normal if you follow these steps.

  • I am not able to access the App Store on my Iphone 3GS with IOS 6.01, however i can access the same on my laptop when i connect my phone to my PC. Any suggestions on this.

    I am not able to access the App Store on my Iphone 3GS with IOS 6.01, however i can access the same on my laptop when i connect my phone to my PC. Any suggestions on this.

    varunsharmaapplefan
    http://support.apple.com/kb/ht5209 might help you.  An iPhone 4 can airplay content from apps that support airplay and iTunes but it cannot mirror.  If your game does not have airplay in the app you cannot mirror it to the apple TV so I don't know if you can play just the music.  You should have no problem playing your iTunes over airplay though.
    This may also help http://support.apple.com/kb/HT4437
    Regards
    Jules 

  • Can i delete all my cookies and still be able to access the websites some of the cookies came from

    can i delete all my cookies and still be able to access the websites some of the cookies came from?

    macbookproproblems wrote:
    can i delete all my cookies and still be able to access the websites some of the cookies came from?
    If you Reset Safari, it's supposed too.
    http://support.apple.com/kb/PH11914
    http://www.html-kit.com/tools/cookietester/

  • I subscribe to the Scotsman newspaper through itunes.  The Paper is accessed through Newsstand.  According to their support I should be able to access the paper on up to five devices, but I can't open it on our second ipad.  Support at the paper can'

    I subscribe to the Scotsman newspaper through itunes.  The Paper is accessed through Newsstand.  According to their support I should be able to access the paper on up to five devices, but I can't open it on our mini ipad.  Support at the paper can't help. It does work on our other ipad.

    I click on Newsstand, then search for The Scotsman.   When I click on The Scotsman App there is no option to Download, only the OPEN box.  When I click on OPEN nothing happens.    It seems to know I'm already subscribed - it shows the subscription under In-App purchases but it doesn't open. I've also tried getting in using Featured and Purchased at the bottom of the screen, but nothing works.  Thanks for trying to help.

  • Downloading songs to my iphone duplicates and i can't access the duplicate songs.

    Downloading songs to my iphone duplicates and i can't access the duplicate song.

    My first advice is "Back up the device, then have it replaced."  Second item of advice, "Don't forget your passcode."
    One of the purposes of the lock button is to recover from certain software failures.  Without the lock button, such a recovery is nearly impossible.  My advice would have served you best when the malfuction first developed, not after you forgot your passcode.

  • Upgraded to Mountain Lion and CS3, I am no longer able to access the correct dialog box for fine printing with Epson Stylus Photo 1400.

    I have recently upgraded my Mac OS to Mountain Lion, and am using Photoshop CS3 together with Lightroom 5. To my absolute horror, in either Adobe program I am no longer able to access the dialog box which allows me to choose paper type, size, and print quality when attempting to print on my Epson Stylus Photo 1400. An excruciating hour on the phone with largely unintelligible folks at Epson seemed to prove the problem lies with Adobe instead of Epson. I'd greatly appreciate whatever advice might be forthcoming from the Community.

    Well, this seemed to work.. can't believe it! After a year of messing with this!
    from Stevejones5
    "I found a way around this problem. GO to HD/Library/Printers/Epson/InkjetPrinter/ICCProfiles and you will find a file labeled Pro38.profiles. This is a package file. Control click on it and reveal contents. Then you can copy all the profiles and paste them into your Colorsync folder either in the HD/Library folder or your own Home folder/Library. Then the profiles will show up in Photoshop and Lightroom."
    Key, is to Control click on the printer to "Open contents". Then open Resource folder. Copy everything in it and then paste it into the "Colorsync" folder in your Library.  (Remember, to get to Library you have to hold the command key down for it to appear in "Go" Menu for Finder.
    Then I reinstalled printer driver from Apple, then rebooted computer, then plugged in printer. And VOILA-- I can now select Epson Premium Photo Paper Luster!

  • Why isn't my iTunes store loading properly? It lists everything in text without images, and I can't seem to access the store when I try to search for music or movies etc.

    Why isn't my iTunes store loading properly? It lists everything in text without images, and I can't seem to access the store when I try to search for music or movies etc.

    1) The best way to relocate the iTunes library folder is to move the entire iTunes folder with all subfolders to the new path, then press and hold down shift as start iTunes and keep holding until prompted to choose a library, then browse to the relocated folder and open the file iTunes Library.itl inside it.
    If you've done something different then provide some more details about what is where and I should be able to help.
    2) Purchases on the device should automatically transfer to a Purchased on <DeviceName> playlist, but it my depend a bit on whether automatic iCloud downloads are enabled. If there is a cloudy link then the transfer might not happen. You can use File > Devices > Transfer Purchases. In iTunes you should also check out iTunes Store > Quick Links > Purchased > Music > Not on this computer.
    3) Backup the device, then immediately restore it. In some cases you need to add a restore as new device into that equation. Obbviously not to be attempted until you're sure all your media is in your library. See Recover your iTunes library from your iPod or iOS device should it be needed.
    4) I believe there is complimentary 1 incident 90-day support with hardware purchases, but no free software support for iTunes itself. AppleCare gets you a different level of support.
    tt2

  • User has contribute access but he is not able to access the site collection...

    User has contribute access but he is not able to access the site collection...

    What error does he get.
    Can you share fiddler trace(check if any 404 error)
    what error do we see in ULS Logs
    Create disableloopback
    registry on server
    http://support.microsoft.com/kb/926642/en-us

Maybe you are looking for

  • INCOTERMS : Different Incoterms for a Customer by Plant

    Hi there, I have a customer - ABC. ABC's sales orders are fulfilled from 2 Plants - X and Y. X and Y are in two different countries (one in EU, one non-EU). Rerquirement is to have different incoterms based on what plant the customer's sales order is

  • SCSM 2012 R2 UR5 Console Crashes When Viewing Business Service Components

    I have an issue where a business service which has been synced from SCOM 2012 R2 into the CMDB I am unable to view the service components without the console crashing. This is occurring on all business services with service components present. The er

  • Is it possible to turn off the accelerometer?

    is it possible? sometimes it's too annoying especially when you're browsing the website while lying down and you don't want to view it in landscape mode. is there such thing? help thanks

  • My video ipods album artwork keep switching HELP PLEASE!!!

    for certain songs or certain albums the album artwork will be another albums album artwork and i cannot figure out what to do! please help me!

  • Expired RMAN backupset?

    Dear all, I copied all the RMAN backupset and found this is expired. Is it possible to make this valid, NOT EXPIRED. backup piece handle=/backup/db/backup/RMAN/backup_PROD_748148532_40523_1_ibm9flpk_1_1.bck recid=40515 stamp=748148534 crosschecked ba