SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: mental Block

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    Pennsylvania
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mental Block

    Okay, I seem to have some kind of learning block going on here and I cannot find the answer anywhere.

    In C#, when I have to output something, in a console application, I output the using the system.console.writeline(); method.

    Console.WriteLine("This is some output"); //This will output to a console window the text, "This is some output".

    Now, when I create a window using the windows form or the WPF.....I have a graphical interface that is a blank window.

    How do I output to that window using the same kind of method?

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    With WPF or WinForms, you can use a message box to quickly spit out output:

    http://msdn.microsoft.com/en-us/libr...essagebox.aspx
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,220
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    Yes, you can use a messagebox, or if you open the Toolbox (Ctrl + X) or View > Toolbox, you can drag a label to the GUI and then use labelname.Text = "My Message";

  4. #4
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,649
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Messageboxes suck for output -- unless you like speaking through modal dialogs.

    WPF and winforms are vastly different beasts. For winforms, I used to just build a multiline textbox and append lines to the bottom to catch the output sort of messages one would Console.WriteLine(). WPF wants you to do some databinding stuff I never quite got my head around enough to explain.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •