Click here to Skip to main content
15,892,298 members
Home / Discussions / C#
   

C#

 
QuestionChange a property with strings Pin
softwarejaeger9-Dec-08 22:45
softwarejaeger9-Dec-08 22:45 
AnswerRe: Change a property with strings Pin
Mirko19809-Dec-08 22:59
Mirko19809-Dec-08 22:59 
GeneralRe: Change a property with strings Pin
softwarejaeger9-Dec-08 23:37
softwarejaeger9-Dec-08 23:37 
GeneralRe: Change a property with strings Pin
Mirko19809-Dec-08 23:49
Mirko19809-Dec-08 23:49 
GeneralRe: Change a property with strings Pin
softwarejaeger10-Dec-08 0:15
softwarejaeger10-Dec-08 0:15 
GeneralRe: Change a property with strings Pin
Mirko198010-Dec-08 0:23
Mirko198010-Dec-08 0:23 
GeneralRe: Change a property with strings Pin
softwarejaeger10-Dec-08 0:59
softwarejaeger10-Dec-08 0:59 
GeneralRe: Change a property with strings Pin
Mirko198010-Dec-08 2:08
Mirko198010-Dec-08 2:08 
I tried it: actually, the not-reflection property assignment (button1.Location.X = 10;) gives a compiler error "Cannot modify the return value of 'System.Windows.Forms.Control.Location' because it is not a variable".

As always, MSDN[^] has the answer: Because the Point class is a value type (Structure in Visual Basic, struct in Visual C#), it is returned by value, meaning accessing the property returns a copy of the upper-left point of the control. So, adjusting the X or Y properties of the Point returned from this property will not affect the Left, Right, Top, or Bottom property values of the control. To adjust these properties set each property value individually, or set the Location property with a new Point.

Sure you choose a tricky case to practice Reflection Smile | :)
Questionrealtime price feed Pin
devvvy9-Dec-08 21:59
devvvy9-Dec-08 21:59 
QuestionC# components Pin
Dreekebe9-Dec-08 21:45
Dreekebe9-Dec-08 21:45 
AnswerRe: C# components Pin
TJS4u9-Dec-08 22:01
TJS4u9-Dec-08 22:01 
AnswerRe: C# components Pin
SeMartens9-Dec-08 22:05
SeMartens9-Dec-08 22:05 
GeneralRe: C# components Pin
Dreekebe9-Dec-08 22:19
Dreekebe9-Dec-08 22:19 
AnswerRe: C# components Pin
Giorgi Dalakishvili9-Dec-08 22:20
mentorGiorgi Dalakishvili9-Dec-08 22:20 
GeneralRe: C# components Pin
Dreekebe9-Dec-08 22:29
Dreekebe9-Dec-08 22:29 
AnswerRe: C# components Pin
Tom Deketelaere9-Dec-08 23:05
professionalTom Deketelaere9-Dec-08 23:05 
GeneralRe: C# components Pin
Dreekebe9-Dec-08 23:44
Dreekebe9-Dec-08 23:44 
QuestionList View Scroll Bar Pin
half-life9-Dec-08 21:23
half-life9-Dec-08 21:23 
AnswerRe: List View Scroll Bar Pin
TJS4u9-Dec-08 21:49
TJS4u9-Dec-08 21:49 
AnswerRe: List View Scroll Bar Pin
moon_stick9-Dec-08 23:07
moon_stick9-Dec-08 23:07 
QuestionRadioBoutton as a group Pin
CodingLover9-Dec-08 19:49
CodingLover9-Dec-08 19:49 
AnswerRe: RadioBoutton as a group Pin
Chintan.Desai9-Dec-08 19:55
Chintan.Desai9-Dec-08 19:55 
AnswerRe: RadioBoutton as a group Pin
N a v a n e e t h9-Dec-08 20:03
N a v a n e e t h9-Dec-08 20:03 
QuestionRe: RadioBoutton as a group Pin
CodingLover9-Dec-08 20:28
CodingLover9-Dec-08 20:28 
AnswerRe: RadioBoutton as a group Pin
dan!sh 9-Dec-08 20:58
professional dan!sh 9-Dec-08 20:58 

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.