Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
Questionconnecting remote mysql database using c#.net Pin
dilip51422-Feb-09 18:08
dilip51422-Feb-09 18:08 
AnswerRe: connecting remote mysql database using c#.net Pin
Christian Graus22-Feb-09 18:31
protectorChristian Graus22-Feb-09 18:31 
AnswerRe: connecting remote mysql database using c#.net Pin
RobScripta23-Feb-09 7:37
professionalRobScripta23-Feb-09 7:37 
QuestionProgress Bar And Data Process Pin
BlitzPackage22-Feb-09 17:28
BlitzPackage22-Feb-09 17:28 
AnswerRe: Progress Bar And Data Process Pin
Jon Rista22-Feb-09 18:14
Jon Rista22-Feb-09 18:14 
GeneralRe: Progress Bar And Data Process Pin
BlitzPackage22-Feb-09 19:21
BlitzPackage22-Feb-09 19:21 
QuestionWorking with multiple threads. Pin
CodingLover22-Feb-09 16:54
CodingLover22-Feb-09 16:54 
AnswerRe: Working with multiple threads. Pin
ABitSmart22-Feb-09 17:06
ABitSmart22-Feb-09 17:06 
GeneralRe: Working with multiple threads. Pin
CodingLover22-Feb-09 21:06
CodingLover22-Feb-09 21:06 
QuestionHow to create a new keyword Pin
damichab22-Feb-09 14:52
damichab22-Feb-09 14:52 
AnswerRe: How to create a new keyword Pin
PIEBALDconsult22-Feb-09 15:52
mvePIEBALDconsult22-Feb-09 15:52 
GeneralRe: How to create a new keyword Pin
damichab22-Feb-09 16:43
damichab22-Feb-09 16:43 
GeneralRe: How to create a new keyword Pin
Jon Rista22-Feb-09 18:10
Jon Rista22-Feb-09 18:10 
AnswerRe: How to create a new keyword Pin
damichab23-Feb-09 11:09
damichab23-Feb-09 11:09 
Questioncustomize deserialization sample in C#? Pin
George_George22-Feb-09 14:48
George_George22-Feb-09 14:48 
AnswerRe: customize deserialization sample in C#? Pin
Zap-Man22-Feb-09 15:05
Zap-Man22-Feb-09 15:05 
GeneralRe: customize deserialization sample in C#? Pin
George_George22-Feb-09 15:45
George_George22-Feb-09 15:45 
QuestionMaking the enter(return) key call a Validated event Pin
High0ctane22-Feb-09 12:54
High0ctane22-Feb-09 12:54 
AnswerRe: Making the enter(return) key call a Validated event Pin
Megidolaon23-Feb-09 3:10
Megidolaon23-Feb-09 3:10 
Try something like this:
public partial class Form1 : Form
    {
        List<button> buttons = new List<button>();
        int counter = 0;
        int maxButtons = 10;

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try 
	        {
                if (counter < maxButtons)
                {
                    Point loc = new Point();

                    buttons.Add(new Button());

                    loc.X = ClientRectangle.X + (counter * 50);
                    loc.Y = ClientRectangle.Y + (counter * 50);

                    buttons[counter].Location = loc;
                    buttons[counter].Name = "Input name with some variable?";
                    buttons[counter].Click += new EventHandler(ButtonClickEvent1);
                    this.Controls.Add(buttons[counter]);

                    counter++;
                }
                else
                {
                    throw(new Exception("Too many buttons"));
                }
	        }   
	        catch (Exception ex)
        	{
                MessageBox.Show("A system error ocurred:\n" + ex.Message, "System Error", 
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
	        }
            
        }

        void ButtonClickEvent1(object sender, EventArgs e)
        { 
            //Insert code here, I don't know how to create evnt dynamically.
            //Thus, I'd have to write a limited amount of events and could only have the user create
            //this many butons.
        }
        
        void ButtonClickEvent2(object sender, EventArgs e)
        {
            //Insert code here, I don't know how to create evnt dynamically.
            //Thus, I'd have to write a limited amount of events and could only have the user create
            //this many butons.
        }
    }</button></button>

AnswerRe: Making the enter(return) key call a Validated event Pin
Richard Dean14-Apr-09 7:28
Richard Dean14-Apr-09 7:28 
QuestionC# area map Pin
Zap-Man22-Feb-09 12:01
Zap-Man22-Feb-09 12:01 
AnswerRe: C# area map Pin
fly90422-Feb-09 12:13
fly90422-Feb-09 12:13 
GeneralRe: C# area map Pin
Zap-Man22-Feb-09 14:40
Zap-Man22-Feb-09 14:40 
GeneralRe: C# area map Pin
fly90422-Feb-09 15:06
fly90422-Feb-09 15:06 
GeneralRe: C# area map Pin
Zap-Man22-Feb-09 15:18
Zap-Man22-Feb-09 15:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.