Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
AnswerRe: Label update Pin
Luc Pattyn30-Jan-07 2:05
sitebuilderLuc Pattyn30-Jan-07 2:05 
GeneralRe: Label update Pin
imnotso#30-Jan-07 2:12
imnotso#30-Jan-07 2:12 
GeneralRe: Label update Pin
Martin#30-Jan-07 2:20
Martin#30-Jan-07 2:20 
GeneralRe: Label update Pin
imnotso#30-Jan-07 2:42
imnotso#30-Jan-07 2:42 
GeneralRe: Label update Pin
Martin#30-Jan-07 2:55
Martin#30-Jan-07 2:55 
GeneralRe: Label update Pin
imnotso#30-Jan-07 4:00
imnotso#30-Jan-07 4:00 
GeneralRe: Label update Pin
Martin#30-Jan-07 4:05
Martin#30-Jan-07 4:05 
GeneralRe: Label update [modified] Pin
Luc Pattyn30-Jan-07 2:42
sitebuilderLuc Pattyn30-Jan-07 2:42 
Labels are reference types, putting an existing label in an array (or some other collection)
is just an administrative operation, it does not change your label, nor does it create
a new one. It does provide a structured way to access one or more labels afterwards, as in:

Label[] myLabels=new Label[37];  // creates an array capable of holding 37 labels
for (int i=0; i<=36; i++) {
    Label label=new Label();     // creates a new label
    label.Text="number "+i;
    myForm.Controls.Add(label);  // add label to form
    myLabels[i]=label;           // and add same label to array
}
// now use the array to modify one label:
myLabels[7].Text="I was here";   // the 7th label gets a new text !


This snippet shows run-time actions to create labels and to add them to the form.
It does not include the code to take care of size, font, and location !
You could add these at will.

Smile | :)


-- modified at 9:02 Tuesday 30th January, 2007

Luc Pattyn

AnswerRe: Label update Pin
Jasmine250130-Jan-07 5:53
Jasmine250130-Jan-07 5:53 
GeneralRe: Label update [modified] Pin
imnotso#30-Jan-07 6:13
imnotso#30-Jan-07 6:13 
GeneralRe: Label update Pin
Dan Neely30-Jan-07 6:45
Dan Neely30-Jan-07 6:45 
GeneralRe: Label update Pin
Jasmine250130-Jan-07 18:34
Jasmine250130-Jan-07 18:34 
GeneralRe: Label update Pin
Jasmine250130-Jan-07 18:39
Jasmine250130-Jan-07 18:39 
GeneralRe: Label update Pin
imnotso#30-Jan-07 23:17
imnotso#30-Jan-07 23:17 
Questionconvert c# to vb.net Pin
Doritkatz30-Jan-07 1:00
Doritkatz30-Jan-07 1:00 
AnswerRe: convert c# to vb.net Pin
andre_swnpl30-Jan-07 1:19
andre_swnpl30-Jan-07 1:19 
GeneralRe: convert c# to vb.net Pin
Doritkatz30-Jan-07 1:55
Doritkatz30-Jan-07 1:55 
AnswerRe: convert c# to vb.net Pin
Pete O'Hanlon30-Jan-07 1:20
mvePete O'Hanlon30-Jan-07 1:20 
GeneralRe: convert c# to vb.net Pin
Martin#30-Jan-07 1:32
Martin#30-Jan-07 1:32 
AnswerRe: convert c# to vb.net Pin
Dave Doknjas30-Jan-07 13:42
Dave Doknjas30-Jan-07 13:42 
QuestionSending a crypt Email with Attachment Pin
olivier29-Jan-07 23:37
olivier29-Jan-07 23:37 
QuestionGet File Name Pin
ParimalaRadjaram29-Jan-07 23:26
ParimalaRadjaram29-Jan-07 23:26 
AnswerRe: Get File Name Pin
Pete O'Hanlon29-Jan-07 23:33
mvePete O'Hanlon29-Jan-07 23:33 
GeneralRe: Get File Name Pin
ParimalaRadjaram29-Jan-07 23:35
ParimalaRadjaram29-Jan-07 23:35 
GeneralRe: Get File Name Pin
bobsugar22229-Jan-07 23:39
bobsugar22229-Jan-07 23:39 

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.