Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6166401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:19:59+00:00 2026-05-23T22:19:59+00:00

I am trying to create controls at runtime by using an XML file. How

  • 0

I am trying to create controls at runtime by using an XML file. How would I access these controls after creating them with names specified by the XML file?

For instance, if I had a series of controls in an XML file:

<control id="0" type="textbox">
   <param id="0" type="(name)">DynamicTextbox</param>
   <param id="1" type="location">100,73</param>
   <param id="2" type="size">119,20</param>
</control>
<control id="1" type="button">
   <param id="0" type="(name)">DynamicButton</param>
   <param id="1" type="location">200,82</param>
   <param id="2" type="size">78,50</param>
</control>

If I designed the UI in design mode, and I didn’t use the XML file, I could simply call the controls with their respective names.

DynamicTextbox.location = new Point(100,73);
DynamicTextbox.size = new Size(119,20);

DynamicButton.location = new Point(200,82);
DynamicButton.size = new Size(78,50);

Since I am creating the controls at runtime, how would I access them with those names?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:20:00+00:00Added an answer on May 23, 2026 at 10:20 pm

    I take it you are adding the control to a UI element? YOu should be able to access them through that. So in WinForms you might have something like…

    TextBox tb = new TextBox();
    tb.Name = "DynamicTextbox";
    Panel1.Controls.Add(tb);
    
    TextBox tb = (TextBox)Panel1.Controls["DynamicTextbox"];
    

    If this doesn’t help then let us know what type of application you are working with (WinForms, WPF, ASP.NET etc.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to dynamically create controls and give them properties during run time.
I am trying to create a method that accepts multiple types of controls -
I'm trying to create an access control system. Here's a stripped down example of
I am trying to create buttons at runtime. My Question is that How should
I am trying to create a WPF control at runtime, but I can't figure
How can I create an instance of a web control at runtime using reflection?
I am trying to create a GUI to display information read from a file.
I have been trying to control a camera through a wsdl file using SUDS.
I'm trying to create User Control which will work like a rich button. It's
Im trying to create a user control menu where links to a page's usercontrols

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.