Click here to Skip to main content
15,867,835 members
Home / Discussions / C#
   

C#

 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Eddy Vluggen23-Jan-18 0:20
professionalEddy Vluggen23-Jan-18 0:20 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Gerry Schmitz23-Jan-18 7:37
mveGerry Schmitz23-Jan-18 7:37 
QuestionHow to insert the XML file in SQL Server Pin
Jieha Lee19-Jan-18 4:23
Jieha Lee19-Jan-18 4:23 
AnswerRe: How to insert the XML file in SQL Server Pin
OriginalGriff19-Jan-18 4:58
mveOriginalGriff19-Jan-18 4:58 
AnswerRe: How to insert the XML file in SQL Server Pin
jschell20-Jan-18 5:54
jschell20-Jan-18 5:54 
GeneralRe: How to insert the XML file in SQL Server Pin
Laxmidhar tatwa technologies23-Jan-18 5:00
Laxmidhar tatwa technologies23-Jan-18 5:00 
GeneralRe: How to insert the XML file in SQL Server Pin
jschell27-Jan-18 5:09
jschell27-Jan-18 5:09 
QuestionCalling a Method from a Form event Pin
ormonds18-Jan-18 14:08
ormonds18-Jan-18 14:08 
Can someone please help a newbie with what I suspect is a simple error?
Program.cs:
using System.IO;

namespace CreateDT
{
    static class Program
    {
        static void Main()
        {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Form1());
        }
        static void MyMethod (name1 string, name2 string)
        {
        // do some stuff with files using the names provided
        }
    }
}

Form1.cs:
using System;
// other using statements

namespace CreateDT
{
    public partial class Form1 : Form
    {
        //variable definitions..
        public Form1()
        {
             InitializeComponent();
        }
        private void DoItButton_Click(object sender, EventArgs e)
        {
        // set names of currentfile, TargetFile
        MyMethod(currentfile, TargetFile);
        }

Gives error "CS0103 The name 'MyMethod' does not exist in the current context." I've looked at lots of examples which all seem to be done this way. Obviously not, what am I missing?
AnswerRe: Calling a Method from a Form event Pin
User 740747018-Jan-18 14:35
User 740747018-Jan-18 14:35 
AnswerRe: Calling a Method from a Form event Pin
OriginalGriff18-Jan-18 20:07
mveOriginalGriff18-Jan-18 20:07 
AnswerRe: Calling a Method from a Form event Pin
ormonds19-Jan-18 17:00
ormonds19-Jan-18 17:00 
GeneralRe: Calling a Method from a Form event Pin
OriginalGriff19-Jan-18 20:34
mveOriginalGriff19-Jan-18 20:34 
QuestionWhy ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884018-Jan-18 8:18
Member 1228884018-Jan-18 8:18 
AnswerRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Richard MacCutchan18-Jan-18 21:10
mveRichard MacCutchan18-Jan-18 21:10 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884019-Jan-18 7:44
Member 1228884019-Jan-18 7:44 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Richard MacCutchan19-Jan-18 8:01
mveRichard MacCutchan19-Jan-18 8:01 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884019-Jan-18 11:30
Member 1228884019-Jan-18 11:30 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Pete O'Hanlon19-Jan-18 22:22
subeditorPete O'Hanlon19-Jan-18 22:22 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884020-Jan-18 6:59
Member 1228884020-Jan-18 6:59 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Pete O'Hanlon20-Jan-18 22:27
subeditorPete O'Hanlon20-Jan-18 22:27 
QuestionProject Reference Installed Applications Pin
TheCoolTech18-Jan-18 5:32
TheCoolTech18-Jan-18 5:32 
AnswerRe: Project Reference Installed Applications Pin
OriginalGriff18-Jan-18 5:48
mveOriginalGriff18-Jan-18 5:48 
AnswerRe: Project Reference Installed Applications Pin
Richard MacCutchan18-Jan-18 6:40
mveRichard MacCutchan18-Jan-18 6:40 
QuestionCannot convert from ref decimal? to ref decimal Pin
Kevin Marois18-Jan-18 5:30
professionalKevin Marois18-Jan-18 5:30 
AnswerRe: Cannot convert from ref decimal? to ref decimal Pin
F-ES Sitecore18-Jan-18 6:12
professionalF-ES Sitecore18-Jan-18 6:12 

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.