Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2012/5.0 > C# 2012/5.0 General Discussion
|
C# 2012/5.0 General Discussion Discussions about the C# 2012 language and tool not related to any specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2012/5.0 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 8th, 2013, 11:18 AM
Registered User
 
Join Date: Feb 2013
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default C# adding radio buttons from within the application

I have this program that I have hundreds of radio buttons already on it, but I want to not have to change the code and recompile every time I want to add a new radio button.

For each radio button, I have several text boxes that are filled by set text files.

Code:
if (radioButton1.Checked == true)
{
 System.IO.StreamReader myFile =
 new System.IO.StreamReader("\\file.txt");
 string steps = myFile.ReadToEnd();
 textBox1.Text = steps;
 myFile.Close();

textBox1.Text = steps;
}
This of course is just one out of many different radio buttons, and many different text boxes per radio button, each text would need its own .txt file also.

So I can create a file easily from within the program. But I am wondering how I would set a menu option for adding new radio buttons, so the program can be changed though the program itself. Without having to add code and and recompile. I don't want to ask if this can be done, because I know there is a deffinate way, I just do not know what it is I am looking for to figure out how to do this.

How is it I will add a new radio button from within the application, and update the executable without compiling again?
The Following User Says Thank You to slaitor For This Useful Post:
 
Old July 1st, 2013, 03:22 AM
Registered User
 
Join Date: Jul 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML

I'm trying to do the same thing but with buttons instead of radio buttons. It's my understanding that you could actually eliminate a lot of your code with using an XML file. I'm still trying to learn the process but it would allow creation of these buttons on the fly through the program.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Radio Buttons splendor2 Classic ASP Basics 7 May 26th, 2010 09:35 AM
InfoPath radio buttons MichaelBjerke Infopath 0 May 29th, 2007 10:27 AM
Radio buttons disappear JoeBob49 ASP.NET 2.0 Basics 2 November 27th, 2006 09:57 AM
How to use the radio buttons? ben_VB VB.NET 2002/2003 Basics 1 January 18th, 2005 12:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.