Click here to Skip to main content
15,894,955 members
Home / Discussions / C#
   

C#

 
Questionwhen does the assembly.exe.config file is created Pin
prasadbuddhika15-Mar-10 18:23
prasadbuddhika15-Mar-10 18:23 
AnswerRe: when does the assembly.exe.config file is created Pin
dan!sh 15-Mar-10 18:54
professional dan!sh 15-Mar-10 18:54 
AnswerRe: when does the assembly.exe.config file is created Pin
ramzg15-Mar-10 19:19
ramzg15-Mar-10 19:19 
QuestionVideo Overlay Pin
abalbo15-Mar-10 14:11
abalbo15-Mar-10 14:11 
AnswerRe: Video Overlay Pin
Super Lloyd15-Mar-10 17:37
Super Lloyd15-Mar-10 17:37 
QuestionWPF: how do I write output from methods invoked through an event to a textbox in window1? Pin
Bragee15-Mar-10 12:57
Bragee15-Mar-10 12:57 
AnswerRe: WPF: how do I write output from methods invoked through an event to a textbox in window1? Pin
Not Active15-Mar-10 14:12
mentorNot Active15-Mar-10 14:12 
GeneralRe: WPF: how do I write output from methods invoked through an event to a textbox in window1? Pin
Bragee16-Mar-10 1:16
Bragee16-Mar-10 1:16 
Thank you for your fast reply.

Ok here's some code. I'm still learning so you may find this utterly simple Smile | :)

In my main window the event gets called:

private void button1_Click(object sender, RoutedEventArgs e)
        {

            BallEventArgs bEventArgs = new BallEventArgs(Convert.ToInt16(textBox1.Text), Convert.ToInt16(textBox2.Text));
            ball.OnBallInPlay(bEventArgs);
        }


Then there's e.g. a pitcher class that subscribes to the ball event being raised
public Fan(Ball b)
        {
            b.BallInPlay += new EventHandler(b_BallInPlay);
        }

        void b_BallInPlay(object sender, EventArgs e)
        {
            if (e is BallEventArgs)
            {
                BallEventArgs bea = e as BallEventArgs;
                if (bea.Distance > 400 && bea.Trajectory >30)
                {
                    Homerun();
                }
                else
                {
                    Cheer();
                }
            }


Both Homerun and Cheer return a string. It 's that string that I want to display in a textbox called tbOutput in my Window1.
My problem: I can't seem to access the tbOutput textbox from the Homerun and Cheer methods, because tbOutput is private in Window1.

I don't have a clue...
GeneralRe: WPF: how do I write output from methods invoked through an event to a textbox in window1? Pin
Pete O'Hanlon16-Mar-10 2:16
mvePete O'Hanlon16-Mar-10 2:16 
GeneralRe: WPF: how do I write output from methods invoked through an event to a textbox in window1? Pin
Not Active16-Mar-10 2:26
mentorNot Active16-Mar-10 2:26 
Questioncheck if 5 min have passed Pin
Yustme15-Mar-10 12:53
Yustme15-Mar-10 12:53 
AnswerRe: check if 5 min have passed Pin
Luc Pattyn15-Mar-10 13:00
sitebuilderLuc Pattyn15-Mar-10 13:00 
GeneralRe: check if 5 min have passed Pin
Yustme15-Mar-10 13:40
Yustme15-Mar-10 13:40 
GeneralRe: check if 5 min have passed Pin
Luc Pattyn15-Mar-10 13:46
sitebuilderLuc Pattyn15-Mar-10 13:46 
GeneralRe: check if 5 min have passed Pin
Yustme15-Mar-10 13:49
Yustme15-Mar-10 13:49 
GeneralRe: check if 5 min have passed Pin
Luc Pattyn15-Mar-10 14:01
sitebuilderLuc Pattyn15-Mar-10 14:01 
GeneralRe: check if 5 min have passed Pin
Yustme15-Mar-10 14:08
Yustme15-Mar-10 14:08 
GeneralRe: check if 5 min have passed Pin
Luc Pattyn15-Mar-10 14:12
sitebuilderLuc Pattyn15-Mar-10 14:12 
GeneralRe: check if 5 min have passed Pin
Yustme16-Mar-10 3:17
Yustme16-Mar-10 3:17 
GeneralRe: check if 5 min have passed Pin
Luc Pattyn16-Mar-10 3:56
sitebuilderLuc Pattyn16-Mar-10 3:56 
GeneralRe: check if 5 min have passed Pin
llandyw16-Mar-10 15:26
llandyw16-Mar-10 15:26 
GeneralRe: check if 5 min have passed Pin
Som Shekhar16-Mar-10 20:30
Som Shekhar16-Mar-10 20:30 
QuestionMicrosoft SAPI, Parsing grammar xml with c# Pin
b0bz15-Mar-10 9:40
b0bz15-Mar-10 9:40 
Questionhand gesture recognition Pin
Innayat Ullah15-Mar-10 7:39
Innayat Ullah15-Mar-10 7:39 
Questionupdate tables Pin
netJP12L15-Mar-10 6:16
netJP12L15-Mar-10 6:16 

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.