(C#) Broken code, very simple, need help =) menu

User Tag List

Results 1 to 5 of 5
  1. #1
    Silvera's Avatar Member
    Reputation
    10
    Join Date
    Oct 2009
    Posts
    139
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    (C#) Broken code, very simple, need help =)

    Hi - i just recently started reading up on some C# guides and tutorials. After finally deciding on one, I started doing what it said, and more.
    Now at the end of one of the steps, I get an error. 4 errors, actually. And while I can doubleclick on them and see what is causing it, I don't know what to do about it. And I don't see what I've done wrong.

    Link to current step: InformIT: Sams Teach Yourself C# in 24 Hours > Coding an Interface

    Code:


    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        public partial class fclsViewer : Form
        {
            public fclsViewer()
            {
                InitializeComponent();
            }
            
    
            private void btnQuit_Click(object sender, EventArgs e)
            {
                this.Close();
            }
        }
    
    
    static void Main()
    {
        Application.Run(new fclsViewer());
    
    }
    
    	private void btnSelectPicture_Click(object sender, System.EventArgs e)
    	{
                // Show the open file dialog box.
    			if (ofdSelectPicture.ShowDialog() == DialogResult.OK)
         {          
                    // Load the picture into the picture box.
                    picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName);
                    // Show the name of the file in the form's caption.
                    this.Text = String.Concat("Picture Viewer (" + ofdSelectPicture.FileName + ")");
    		}
    
    	}


    ---------- Post added at 10:44 PM ---------- Previous post was at 10:13 PM ----------

    Updated the code, fixed one of the errors - removed image as well
    Last edited by Silvera; 02-02-2011 at 04:43 PM. Reason: New code

    (C#) Broken code, very simple, need help =)
  2. #2
    snigelmannen's Avatar Member
    Reputation
    27
    Join Date
    Jul 2007
    Posts
    318
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put the solution into a .RAR or .ZIP instead and ill fix it

    ---------- Post added at 12:20 PM ---------- Previous post was at 12:16 PM ----------

    And get the Microsoft Visual C# 2010 Step by Step instead, its a better beginners book.
    " Spy sappin mah sentry! "

  3. #3
    Silvera's Avatar Member
    Reputation
    10
    Join Date
    Oct 2009
    Posts
    139
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Snigel, I fixed the problem. The new error I was getting was a faulted error so I just had to remove a tag.
    Now, why is MS C# 2010 Step by Step better than the one I'm currently using?

  4. #4
    snigelmannen's Avatar Member
    Reputation
    27
    Join Date
    Jul 2007
    Posts
    318
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It covers all the new stuff within C# 4.0, WPF and Windows Forms, its a great starter book with all the source projects included.

    The spoiler contains stuff that we can't discuss here, and its illegal (duh) [spoiler]Torrent it if you cant buy it, projects can be downloaded on Microsofts website[/spoiler]

    You should also consider getting the C# Unleashed, but you might not be that into getting to know the language as I am, I gotta study it in school so I only get the books that are up to date with the newest .NET version
    Last edited by snigelmannen; 02-03-2011 at 02:32 PM.
    " Spy sappin mah sentry! "

  5. #5
    Silvera's Avatar Member
    Reputation
    10
    Join Date
    Oct 2009
    Posts
    139
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But couldn't I continue with that book I'm currently using, and then find the books you suggest and use them?

Similar Threads

  1. [ArcEmu] character is attacking and criting very fast, need help to make blizzlike
    By spoon089 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 06-21-2010, 04:26 AM
  2. [need help] Broken script
    By NineOneOne in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 02-13-2008, 11:40 PM
  3. Need help with my Simple MountNPC
    By freezer1012 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 01-21-2008, 07:53 PM
  4. Simple Lua Script , not working need help!
    By Arugos in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 12-30-2007, 02:06 PM
  5. Need Help - Swimming Is Broken
    By Ganoran in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 11-18-2007, 01:49 PM
All times are GMT -5. The time now is 05:07 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search