I have created a movable picture box using the following code:
picBox.Location = new Point(x, 190);
Where x is a variable.
My question is this, why is it that you have to create a new Point class in order to change the location of the picture box. Is there no Get() or Set() functions. Also is Location a pointer to a Point class, and is the previous Point class deleted when the new class is assigned or is it left for garbage collection.
I also have another question. I discovered how to make a picture box move by studying the Tiny Tennis program starter kit. If I had been trying to figure this out on my own how would I have to go about it, in other words if a programmer was trying to figure this out or some other problem to complete some programming project for a company, how would he find this information I have had a real problem with obtaining this sort information.
I am sure that there must be some sort of logical method for finding answers to these sorts of questions. Please include an example of how one might do this effeciently if possible.
Any help on this is greatly appreciated.
Thanks,
CoderX

C# control question
Scott Cairney
Hi,
The quick way to get help is MSDN.
For example you want to get information about Point in given below example , just put your cursor on the Point and press F1. MSDN will find every thing related to Point for you.
new Point();
MSDN will also show navigation where is Point from…
MSDN Library > .NET Development > .NET Framework SDK > Class Library Reference > System.Drawing > Point Structure > Point Constructor
More Point is a structure not a class so no new instance of class will be created, it will automatically set value of Top & Left.
Hope this help.
Stephen Turton
mEmENT0m0RI
Thanks Mubshir,
Your reply was very helpful, but I have already explored the information on MSDN.
I just seems to me that some programmers know exactly what method or feature to use to get C# to do excatly what they need it to do. I am just wondering if there is not some other source of information. You can find bits and pieces of code in books that make you think wow! how come I couldn't find that method.
Does anyone know of any other reference material
Gary Miller
This makes a lot of sense to me. Thanks for all the help Chris your insite is invaluable.
asi 96
Hi,
Hope these link will be helpful.
http://born4code.com/CMS/modules.php op=modload&name=Web_Links&file=index&req=viewlink&cid=1
http://born4code.com/CMS/modules.php op=modload&name=Downloads&file=index&req=viewsdownload&sid=3
Shapid
>> is the previous Point class deleted when the new class is assigned or is it left for garbage collection.
Basically, the latter, but there is really not much difference between the two options.
lpasquali
picBox.Left = x;
picBox.Top = 100;
Regards,
-chris
Jean Baronas
Thanks Chris. This information is very helpful.
I would still like to know if there is a quick way to find answers such as the Point class topic. There must be some kind of reference or something for a programmer to use.
nadim
The trick is actually the combination of experience and reference. Don't rush it, you'll eventually get better than some of us here.
Cheers,
-chris
Seungho Nam
My personal favorite:
http://www.codeguru.com
http://www.codeproject.com
Regards,
-chris