Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
QuestionUsing strings to name an object Pin
Expert Coming8-Sep-05 12:23
Expert Coming8-Sep-05 12:23 
AnswerRe: Using strings to name an object Pin
Christian Graus8-Sep-05 12:28
protectorChristian Graus8-Sep-05 12:28 
GeneralRe: Using strings to name an object Pin
Expert Coming8-Sep-05 12:29
Expert Coming8-Sep-05 12:29 
GeneralRe: Using strings to name an object Pin
Christian Graus8-Sep-05 12:30
protectorChristian Graus8-Sep-05 12:30 
GeneralRe: Using strings to name an object Pin
Expert Coming8-Sep-05 12:34
Expert Coming8-Sep-05 12:34 
GeneralRe: Using strings to name an object Pin
Christian Graus8-Sep-05 12:58
protectorChristian Graus8-Sep-05 12:58 
GeneralRe: Using strings to name an object Pin
Expert Coming8-Sep-05 13:02
Expert Coming8-Sep-05 13:02 
GeneralRe: Using strings to name an object Pin
Christian Graus8-Sep-05 13:05
protectorChristian Graus8-Sep-05 13:05 
ExpertComing wrote:
I don't REALLY know that the label is going to be "Attack", the database may change

Obviously, but I followed your example, and the fact that you tried to cast a string to a label left me thinking this was what you needed to know.

ExpertComing wrote:
lbl(skill).Text = skill;

You can't name your variables locally like that. You CAN set their ID and tag values in this way.

You need to create a new Label ( just look in the InitializeComponent part of an app with a label predefined to see all the stuff you need to set ), then you can set it's text, and it's id/tag properties.

Oh, is this Winforms, or ASP.NET ?



Christian Graus - Microsoft MVP - C++
GeneralRe: Using strings to name an object Pin
Expert Coming8-Sep-05 13:07
Expert Coming8-Sep-05 13:07 
GeneralRe: Using strings to name an object Pin
Christian Graus8-Sep-05 13:10
protectorChristian Graus8-Sep-05 13:10 
GeneralRe: Using strings to name an object Pin
Expert Coming8-Sep-05 13:12
Expert Coming8-Sep-05 13:12 
GeneralRe: Using strings to name an object Pin
Christian Graus8-Sep-05 13:16
protectorChristian Graus8-Sep-05 13:16 
GeneralRe: Using strings to name an object Pin
Expert Coming8-Sep-05 13:19
Expert Coming8-Sep-05 13:19 
GeneralRe: Using strings to name an object Pin
Christian Graus8-Sep-05 13:20
protectorChristian Graus8-Sep-05 13:20 
GeneralRe: Using strings to name an object Pin
Expert Coming8-Sep-05 13:21
Expert Coming8-Sep-05 13:21 
GeneralRe: Using strings to name an object Pin
Christian Graus8-Sep-05 13:23
protectorChristian Graus8-Sep-05 13:23 
GeneralRe: Using strings to name an object Pin
Expert Coming8-Sep-05 13:26
Expert Coming8-Sep-05 13:26 
GeneralRe: Using strings to name an object Pin
Christian Graus8-Sep-05 13:34
protectorChristian Graus8-Sep-05 13:34 
QuestionModify a c# string passed in c++.net function Pin
firefoxrabbit8-Sep-05 9:29
firefoxrabbit8-Sep-05 9:29 
AnswerRe: Modify a c# string passed in c++.net function Pin
John Fisher8-Sep-05 9:50
John Fisher8-Sep-05 9:50 
GeneralRe: Modify a c# string passed in c++.net function Pin
surfman198-Sep-05 10:11
surfman198-Sep-05 10:11 
Questionregex problem Pin
surfman198-Sep-05 8:53
surfman198-Sep-05 8:53 
AnswerRe: regex problem Pin
User 66588-Sep-05 9:13
User 66588-Sep-05 9:13 
GeneralRe: regex problem Pin
User 66588-Sep-05 9:20
User 66588-Sep-05 9:20 
GeneralRe: regex problem Pin
surfman198-Sep-05 9:35
surfman198-Sep-05 9:35 

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.