L
L
libera2016-03-06 20:06:16
WPF
libera, 2016-03-06 20:06:16

Can't call private C#?

public void test1()
        {
            int a =25;
int b =25;
int c=a+b   
        }
        private void button_Click(object sender, RoutedEventArgs e)
        {
            test1();
        }

Mistake.
It turns
out that the called object was rejected.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
metallix, 2016-03-06
@metallix

I could be wrong, but " button_click " shouldn't be public ?

A
Alexey Pavlov, 2016-03-09
@lexxpavlov

First, provide the text of the error so that we can help you.
And secondly, the test1() method lacks a semicolon in the third line.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question