Click here to Skip to main content
14,743,194 members
Home » Discussions » C#
   

C#

 
GeneralRe: how I input Hebrew from winForm to mySql Pin
Luc Pattyn16-Jul-19 4:31
sitebuilderLuc Pattyn16-Jul-19 4:31 
GeneralRe: how I input Hebrew from winForm to mySql Pin
Member 1387299916-Jul-19 8:08
MemberMember 1387299916-Jul-19 8:08 
Questionregular expression to extract data from a html table with TD marked with id using C# Pin
Indexon India15-Jul-19 7:06
MemberIndexon India15-Jul-19 7:06 
AnswerRe: regular expression to extract data from a html table with TD marked with id using C# Pin
OriginalGriff15-Jul-19 7:14
mveOriginalGriff15-Jul-19 7:14 
JokeRe: regular expression to extract data from a html table with TD marked with id using C# Pin
Richard Deeming15-Jul-19 8:52
mveRichard Deeming15-Jul-19 8:52 
GeneralRe: regular expression to extract data from a html table with TD marked with id using C# Pin
OriginalGriff15-Jul-19 9:04
mveOriginalGriff15-Jul-19 9:04 
AnswerRe: regular expression to extract data from a html table with TD marked with id using C# Pin
#realJSOP16-Jul-19 0:39
mva#realJSOP16-Jul-19 0:39 
QuestionC# error: “An object reference is required for the non-static field, method, or property” Pin
wrightyrx715-Jul-19 0:24
Memberwrightyrx715-Jul-19 0:24 
Im trying to figure out Delegates as I have read this is the best way to pass Values from one form to another.

I have tried to do this but am getting an error.

So to test I am trying to do the following.

Form1 has a button which opens Form2 which contains a DatePicker. The user selects a date and clicks OK. I then want the date passed back to a textbox on Form1.

This is my code.

FORM1 - CODE (The getEffDate in this code is where im getting the error.)

private void TestingButton_Click(object sender, EventArgs e)
{
    Form_EffectiveDate effDate = new Form_EffectiveDate();           
        if (effDate.ShowDialog() == DialogResult.OK)
        {
        EffDateTextBox.Text = Form_EffectiveDate.getEffDate;
        }
}


FORM 2 - Code
namespace Manager_Changes
{
    public partial class Form_EffectiveDate : Form
    {
        public delegate void GetEffDate(object sender);
        public GetEffDate getEffDate;

        public Form_EffectiveDate()
        {
            InitializeComponent();
        }

        private void DateOKButton_Click(object sender, EventArgs e)
        {
            getEffDate(effDateTimePicker.Value.ToString());
            DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
    }
}   

Chris Wright

AnswerRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
OriginalGriff15-Jul-19 0:35
mveOriginalGriff15-Jul-19 0:35 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
wrightyrx715-Jul-19 0:50
Memberwrightyrx715-Jul-19 0:50 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
OriginalGriff15-Jul-19 1:17
mveOriginalGriff15-Jul-19 1:17 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
wrightyrx715-Jul-19 1:33
Memberwrightyrx715-Jul-19 1:33 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
OriginalGriff15-Jul-19 1:47
mveOriginalGriff15-Jul-19 1:47 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
wrightyrx715-Jul-19 4:08
Memberwrightyrx715-Jul-19 4:08 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
OriginalGriff15-Jul-19 4:46
mveOriginalGriff15-Jul-19 4:46 
AnswerRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
phil.o15-Jul-19 0:52
mvephil.o15-Jul-19 0:52 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
wrightyrx715-Jul-19 1:34
Memberwrightyrx715-Jul-19 1:34 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
phil.o15-Jul-19 1:43
mvephil.o15-Jul-19 1:43 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
wrightyrx715-Jul-19 2:00
Memberwrightyrx715-Jul-19 2:00 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
OriginalGriff15-Jul-19 2:30
mveOriginalGriff15-Jul-19 2:30 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
wrightyrx715-Jul-19 2:35
Memberwrightyrx715-Jul-19 2:35 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
OriginalGriff15-Jul-19 2:47
mveOriginalGriff15-Jul-19 2:47 
GeneralRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
phil.o15-Jul-19 2:46
mvephil.o15-Jul-19 2:46 
AnswerRe: C# error: “An object reference is required for the non-static field, method, or property” Pin
Sagar-Jaybhay16-Jul-19 5:19
MemberSagar-Jaybhay16-Jul-19 5:19 
QuestionPowerpoint addin - where to start? Pin
pr1mem0ver12-Jul-19 6:04
Memberpr1mem0ver12-Jul-19 6:04 

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.