Click here to Skip to main content
15,891,529 members
Home / Discussions / C#
   

C#

 
AnswerRe: Changing textBox from Method Pin
Eddy Vluggen21-Feb-19 11:07
professionalEddy Vluggen21-Feb-19 11:07 
AnswerRe: Changing textBox from Method Pin
Mycroft Holmes21-Feb-19 11:11
professionalMycroft Holmes21-Feb-19 11:11 
GeneralRe: Changing textBox from Method Pin
ormonds21-Feb-19 16:48
ormonds21-Feb-19 16:48 
QuestionWHENTO Expect C# 8 to be released with Visual Studio and Default Interface Mathods (aka Multiple Inheritance). Pin
Member 1047477121-Feb-19 4:06
professionalMember 1047477121-Feb-19 4:06 
AnswerRe: WHENTO Expect C# 8 to be released with Visual Studio and Default Interface Mathods (aka Multiple Inheritance). Pin
Eddy Vluggen21-Feb-19 4:16
professionalEddy Vluggen21-Feb-19 4:16 
AnswerRe: WHENTO Expect C# 8 to be released with Visual Studio and Default Interface Mathods (aka Multiple Inheritance). Pin
Dave Kreskowiak21-Feb-19 5:03
mveDave Kreskowiak21-Feb-19 5:03 
AnswerRe: WHENTO Expect C# 8 to be released with Visual Studio and Default Interface Mathods (aka Multiple Inheritance). Pin
OriginalGriff21-Feb-19 5:14
mveOriginalGriff21-Feb-19 5:14 
QuestionEnabling Control from Method Pin
ormonds20-Feb-19 12:22
ormonds20-Feb-19 12:22 
I know I am going to be embarassed when I see the answer, but here goes. I have a simple app which looks like this:-
C#
namespace ThisProg
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            form = this;
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            textBox2.Text = "Initialising.....";
            Refresh();
            button1.Enabled= false;
        }
        public static void FinishOff(int ErrorLevel)
        {
            button1.Enabled = true; // this line gives error CS0120 An object reference is required for the non-static field, method, or property 'Form1.button1'
        }
        private void button1_Click(object sender, EventArgs e)
        {
            System.Environment.Exit(1);
        }
    }
}
I've tried enabling the button using this.button1, Form1.button1, same error. Help much appreciated.

modified 21-Feb-19 3:45am.

AnswerRe: Enabling Control from Method Pin
Dave Kreskowiak20-Feb-19 14:04
mveDave Kreskowiak20-Feb-19 14:04 
AnswerRe: Enabling Control from Method Pin
OriginalGriff20-Feb-19 20:18
mveOriginalGriff20-Feb-19 20:18 
PraiseRe: Enabling Control from Method Pin
ormonds20-Feb-19 21:14
ormonds20-Feb-19 21:14 
GeneralRe: Enabling Control from Method Pin
OriginalGriff20-Feb-19 21:27
mveOriginalGriff20-Feb-19 21:27 
GeneralRe: Enabling Control from Method Pin
Richard MacCutchan21-Feb-19 1:05
mveRichard MacCutchan21-Feb-19 1:05 
QuestionRetrieve all comments in a worksheet using OpenXML Pin
Gli Invicibili18-Feb-19 18:29
Gli Invicibili18-Feb-19 18:29 
AnswerRe: Retrieve all comments in a worksheet using OpenXML Pin
Richard MacCutchan18-Feb-19 21:32
mveRichard MacCutchan18-Feb-19 21:32 
Question(Kinda SOLVED) Active Directory update (do I really need "Run As Administrator"?!) Pin
Super Lloyd18-Feb-19 13:11
Super Lloyd18-Feb-19 13:11 
QuestionOverridden OnPaint method not called on form Pin
pr1mem0ver17-Feb-19 22:37
pr1mem0ver17-Feb-19 22:37 
AnswerRe: Overridden OnPaint method not called on form Pin
OriginalGriff17-Feb-19 23:02
mveOriginalGriff17-Feb-19 23:02 
GeneralRe: Overridden OnPaint method not called on form Pin
pr1mem0ver17-Feb-19 23:47
pr1mem0ver17-Feb-19 23:47 
GeneralRe: Overridden OnPaint method not called on form Pin
OriginalGriff18-Feb-19 0:04
mveOriginalGriff18-Feb-19 0:04 
SuggestionRe: Overridden OnPaint method not called on form Pin
Ralf Meier18-Feb-19 0:08
mveRalf Meier18-Feb-19 0:08 
QuestionRe: Overridden OnPaint method not called on form Pin
Richard MacCutchan18-Feb-19 0:45
mveRichard MacCutchan18-Feb-19 0:45 
GeneralRe: Overridden OnPaint method not called on form Pin
pr1mem0ver18-Feb-19 3:11
pr1mem0ver18-Feb-19 3:11 
GeneralRe: Overridden OnPaint method not called on form Pin
Richard MacCutchan18-Feb-19 3:51
mveRichard MacCutchan18-Feb-19 3:51 
GeneralRe: Overridden OnPaint method not called on form Pin
pr1mem0ver18-Feb-19 10:31
pr1mem0ver18-Feb-19 10:31 

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.