Click here to Skip to main content
15,915,163 members
Home / Discussions / C#
   

C#

 
AnswerRe: GNU license question (version 2) Pin
Stanciu Vlad28-Mar-07 8:20
Stanciu Vlad28-Mar-07 8:20 
GeneralRe: GNU license question (version 2) Pin
Wayne Phipps28-Mar-07 9:25
Wayne Phipps28-Mar-07 9:25 
GeneralRe: GNU license question (version 2) Pin
kamPooh28-Mar-07 15:34
kamPooh28-Mar-07 15:34 
GeneralRe: GNU license question (version 2) Pin
Nathan Addy28-Mar-07 15:52
Nathan Addy28-Mar-07 15:52 
QuestionHow to delete PDF files after viewing Pin
AndrusM28-Mar-07 5:50
AndrusM28-Mar-07 5:50 
QuestionAdapting form size to content size Pin
sinosoidal28-Mar-07 5:45
sinosoidal28-Mar-07 5:45 
AnswerRe: Adapting form size to content size Pin
Obaid ur Rehman28-Mar-07 7:43
Obaid ur Rehman28-Mar-07 7:43 
AnswerRe: Adapting form size to content size Pin
Arjun "Mjolnir" Bahree28-Mar-07 10:20
Arjun "Mjolnir" Bahree28-Mar-07 10:20 
To understand the reason why C# prevents you from doing this, you need to understand the basics of value types (or structures).

Unlike reference types, when value types are returned from methods (or set via an assignment), a copy of the value type is returned and not the orginal version.

In the situation above, Form.Size is a property (which is a method underneath) and it returns the Size value type.

So when you attempt to assign a value to Size.Height, you are actually attempting to assign it to a copy and not the underlying Size structure.

Although, it is technically valid to do this, the C# compiler makes the assumption that this is not what you want to do, and hence fires the compiler error.


Excelsior
Arjun Bahree
"By The Might of Mjolnir"

I Came! I Coded! I Conquered!

AnswerRe: Adapting form size to content size Pin
Arjun "Mjolnir" Bahree28-Mar-07 10:21
Arjun "Mjolnir" Bahree28-Mar-07 10:21 
GeneralRe: Adapting form size to content size Pin
sinosoidal28-Mar-07 23:25
sinosoidal28-Mar-07 23:25 
QuestionMaximized child MDI form Pin
sinosoidal28-Mar-07 5:39
sinosoidal28-Mar-07 5:39 
Questiondisplaying images from a xml file Pin
diducmy28-Mar-07 5:35
diducmy28-Mar-07 5:35 
AnswerRe: displaying images from a xml file Pin
Martin#28-Mar-07 5:56
Martin#28-Mar-07 5:56 
QuestionXmlSerializer and CDATA Pin
theJazzyBrain28-Mar-07 5:15
theJazzyBrain28-Mar-07 5:15 
QuestionConverting a string to currency format Pin
lee.hallows28-Mar-07 5:09
lee.hallows28-Mar-07 5:09 
AnswerRe: Converting a string to currency format Pin
joon vh.28-Mar-07 5:17
joon vh.28-Mar-07 5:17 
QuestionUsing reference parameters when calling an exposed function from a DLL Pin
Dewald28-Mar-07 5:09
Dewald28-Mar-07 5:09 
AnswerRe: Using reference parameters when calling an exposed function from a DLL Pin
m@u28-Mar-07 5:29
m@u28-Mar-07 5:29 
GeneralRe: Using reference parameters when calling an exposed function from a DLL Pin
Dewald28-Mar-07 23:39
Dewald28-Mar-07 23:39 
QuestionGuidance Automation Toolkit or CodeSmith? Pin
wojti28-Mar-07 5:03
wojti28-Mar-07 5:03 
Questioncalling function in parent form from child form Pin
Lordveralix28-Mar-07 4:13
Lordveralix28-Mar-07 4:13 
AnswerRe: calling function in parent form from child form Pin
Pete O'Hanlon28-Mar-07 4:22
mvePete O'Hanlon28-Mar-07 4:22 
GeneralRe: calling function in parent form from child form Pin
Lordveralix28-Mar-07 4:51
Lordveralix28-Mar-07 4:51 
GeneralRe: calling function in parent form from child form Pin
Pete O'Hanlon28-Mar-07 4:54
mvePete O'Hanlon28-Mar-07 4:54 
GeneralRe: calling function in parent form from child form Pin
Lordveralix28-Mar-07 5:13
Lordveralix28-Mar-07 5:13 

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.