Click here to Skip to main content
15,909,242 members
Home / Discussions / C#
   

C#

 
AnswerRe: Crystal report XI keeps asking for a parameter Pin
Newbie_Toy17-Jun-08 6:38
Newbie_Toy17-Jun-08 6:38 
AnswerRe: Crystal report XI keeps asking for a parameter Pin
SomeGuyThatIsMe17-Jun-08 7:08
SomeGuyThatIsMe17-Jun-08 7:08 
QuestionPCX Files in C# Pin
Chrisfrmatl17-Jun-08 6:28
Chrisfrmatl17-Jun-08 6:28 
AnswerRe: PCX Files in C# Pin
Judah Gabriel Himango17-Jun-08 6:40
sponsorJudah Gabriel Himango17-Jun-08 6:40 
GeneralRe: PCX Files in C# Pin
Chrisfrmatl17-Jun-08 9:24
Chrisfrmatl17-Jun-08 9:24 
GeneralRe: PCX Files in C# Pin
Judah Gabriel Himango17-Jun-08 9:57
sponsorJudah Gabriel Himango17-Jun-08 9:57 
GeneralRe: PCX Files in C# Pin
Chrisfrmatl18-Jun-08 4:27
Chrisfrmatl18-Jun-08 4:27 
QuestionMultiple Labels Pin
djnevs17-Jun-08 6:10
djnevs17-Jun-08 6:10 
Hello,

I am trying to add 'more' Labels in my C# application using a button.
So, when I click the button, a new label needs to be created on my form on pos x,y
I managed to do one. But how do I add more?
I think this is done using a List<>, But I have no idea how that works.

Current source:
private void CreateTextButton(string text)
        {
            // 
            // label1
            // 
            int StartLocationX = 212;
            int SpaceBetweenButtons = 5;
            int NewPosition;
            if (LastPosition != 0)
            {
                NewPosition = LastPosition + SpaceBetweenButtons;
            }
            else
            {
                NewPosition = StartLocationX;
            }

            this.NPCTextButton = new System.Windows.Forms.Label();
            this.NPCTextButton.AutoSize = true;
            this.NPCTextButton.BackColor = System.Drawing.Color.Transparent;
            this.NPCTextButton.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.NPCTextButton.Location = new System.Drawing.Point(NewPosition, 191);
            this.NPCTextButton.Name = text;
            this.NPCTextButton.Size = new System.Drawing.Size(32, 16);
            this.NPCTextButton.TabIndex = 4;
            this.NPCTextButton.Text = text;
            this.NPCTextButton.Click += new System.EventHandler(this.label1_Click);

            this.pictureBox1.Controls.Add(NPCTextButton);
            this.NPCTextButton.BackColor = Color.FromArgb(0, NPCTextButton.BackColor);
            LastPosition = NewPosition;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CreateTextButton(newNPCTextButtonText.Text);
        }


Thanks in advance.
AnswerRe: Multiple Labels Pin
Luc Pattyn17-Jun-08 6:18
sitebuilderLuc Pattyn17-Jun-08 6:18 
GeneralRe: Multiple Labels [modified] Pin
djnevs17-Jun-08 6:55
djnevs17-Jun-08 6:55 
QuestionList of sql server 2005 machines Pin
arkiboys17-Jun-08 5:32
arkiboys17-Jun-08 5:32 
AnswerRe: List of sql server 2005 machines Pin
DavidByram17-Jun-08 5:48
DavidByram17-Jun-08 5:48 
AnswerRe: List of sql server 2005 machines Pin
Parwej Ahamad17-Jun-08 5:50
professionalParwej Ahamad17-Jun-08 5:50 
QuestionConvert generic data to bytes Pin
j.newger17-Jun-08 4:56
j.newger17-Jun-08 4:56 
AnswerRe: Convert generic data to bytes Pin
Anthony Mushrow17-Jun-08 5:01
professionalAnthony Mushrow17-Jun-08 5:01 
GeneralRe: Convert generic data to bytes Pin
j.newger17-Jun-08 5:09
j.newger17-Jun-08 5:09 
AnswerRe: Convert generic data to bytes Pin
Le centriste17-Jun-08 5:07
Le centriste17-Jun-08 5:07 
QuestionRemote DataBase Access Pin
ahmedsamir17-Jun-08 4:34
ahmedsamir17-Jun-08 4:34 
AnswerRe: Remote DataBase Access Pin
Parwej Ahamad17-Jun-08 4:41
professionalParwej Ahamad17-Jun-08 4:41 
GeneralRe: Remote DataBase Access Pin
ahmedsamir19-Jun-08 0:29
ahmedsamir19-Jun-08 0:29 
Questiontrying out UDP socket, and failing.... (on Vista) [modified] Pin
Super Lloyd17-Jun-08 4:33
Super Lloyd17-Jun-08 4:33 
AnswerRe: trying out UDP socket, and failing.... (on Vista) Pin
Parwej Ahamad17-Jun-08 4:42
professionalParwej Ahamad17-Jun-08 4:42 
GeneralRe: trying out UDP socket, and failing.... (on Vista) Pin
Super Lloyd17-Jun-08 4:57
Super Lloyd17-Jun-08 4:57 
AnswerRe: trying out UDP socket, and failing.... (on Vista) Pin
Super Lloyd17-Jun-08 4:54
Super Lloyd17-Jun-08 4:54 
QuestionEntity Framework Pin
Brendan Vogt17-Jun-08 4:26
Brendan Vogt17-Jun-08 4:26 

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.