Click here to Skip to main content
15,906,708 members
Home / Discussions / C#
   

C#

 
Questioncapture image automatic Pin
Member 125746329-Jun-16 2:11
Member 125746329-Jun-16 2:11 
AnswerRe: capture image automatic Pin
Chris Quinn9-Jun-16 2:30
Chris Quinn9-Jun-16 2:30 
AnswerRe: capture image automatic Pin
ZurdoDev9-Jun-16 2:33
professionalZurdoDev9-Jun-16 2:33 
AnswerRe: capture image automatic Pin
Pete O'Hanlon9-Jun-16 2:34
mvePete O'Hanlon9-Jun-16 2:34 
QuestionHow to Convert Amibroker AFL to Dll setup file with License Manager Pin
Member 125746279-Jun-16 2:08
Member 125746279-Jun-16 2:08 
AnswerRe: How to Convert Amibroker AFL to Dll setup file with License Manager Pin
Pete O'Hanlon9-Jun-16 2:15
mvePete O'Hanlon9-Jun-16 2:15 
GeneralRe: How to Convert Amibroker AFL to Dll setup file with License Manager Pin
Member 125746279-Jun-16 2:17
Member 125746279-Jun-16 2:17 
GeneralRe: How to Convert Amibroker AFL to Dll setup file with License Manager Pin
Pete O'Hanlon9-Jun-16 2:33
mvePete O'Hanlon9-Jun-16 2:33 
GeneralRe: How to Convert Amibroker AFL to Dll setup file with License Manager Pin
Eddy Vluggen10-Jun-16 11:55
professionalEddy Vluggen10-Jun-16 11:55 
QuestionItem deleted in control even already assign to another variable. Pin
Le@rner8-Jun-16 21:11
Le@rner8-Jun-16 21:11 
AnswerRe: Item deleted in control even already assign to another variable. Pin
Pete O'Hanlon8-Jun-16 22:27
mvePete O'Hanlon8-Jun-16 22:27 
AnswerRe: Item deleted in control even already assign to another variable. Pin
Richard MacCutchan8-Jun-16 22:43
mveRichard MacCutchan8-Jun-16 22:43 
AnswerRe: Item deleted in control even already assign to another variable. Pin
OriginalGriff8-Jun-16 22:47
mveOriginalGriff8-Jun-16 22:47 
AnswerRe: Item deleted in control even already assign to another variable. Pin
BillWoodruff8-Jun-16 23:05
professionalBillWoodruff8-Jun-16 23:05 
GeneralRe: Item deleted in control even already assign to another variable. Pin
Le@rner9-Jun-16 2:40
Le@rner9-Jun-16 2:40 
QuestionIgnore Error Pin
sunsher8-Jun-16 20:05
sunsher8-Jun-16 20:05 
AnswerRe: Ignore Error Pin
OriginalGriff8-Jun-16 20:30
mveOriginalGriff8-Jun-16 20:30 
GeneralRe: Ignore Error Pin
sunsher12-Jun-16 12:42
sunsher12-Jun-16 12:42 
GeneralRe: Ignore Error Pin
OriginalGriff12-Jun-16 21:05
mveOriginalGriff12-Jun-16 21:05 
QuestionSystem.NullReferenceException Pin
sunsher8-Jun-16 12:48
sunsher8-Jun-16 12:48 
AnswerRe: System.NullReferenceException Pin
Matt T Heffron8-Jun-16 13:56
professionalMatt T Heffron8-Jun-16 13:56 
AnswerRe: System.NullReferenceException Pin
BillWoodruff8-Jun-16 13:58
professionalBillWoodruff8-Jun-16 13:58 
When you declare an instance of the Interface and set it to 'Null, there's nothing "inside" the Interface. I think it would be better in this case if the compiler would refuse to compile that statement.

So, when you try and set the (assume it's the) 'Height property of the Interface instance, it's like you are saying, in effect: "let the Height of nothing be ..."

You need to first create an instance of a Class that inherits from the Interface:
C#
// in NameSpace scope
public interface IDimensions
{
    int Height { set; get; }
}

// in NameSpace scope
public class Dimensions : IDimensions
{
    public int Height { set; get; }

    public Dimensions(int height)
    {
        Height = height;
    }
}

// then create an instance of the Class

// in Form scope: leave off the 'public access modifier if you define the instance in a Method
public Dimensions MyDimensions = new Dimensions(3);

// then you can set the 'Height property at any time

// in some Method or EventHandler
MyDimensions.Height = 12;
If this doesn't clear things up a bit for you, let me know.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008

GeneralRe: System.NullReferenceException Pin
sunsher8-Jun-16 18:57
sunsher8-Jun-16 18:57 
GeneralRe: System.NullReferenceException Pin
sunsher8-Jun-16 19:10
sunsher8-Jun-16 19:10 
GeneralRe: System.NullReferenceException Pin
Pete O'Hanlon8-Jun-16 21:15
mvePete O'Hanlon8-Jun-16 21:15 

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.