Need help to restore running app

This is a discussion on Need help to restore running app within the C# Programming forums, part of the General Programming Boards category; I had a working program (Windows Forms Project) complete with buttons and the underlying code. In an attempt to shortcut ...

  1. #1
    WDT
    WDT is offline
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271

    Need help to restore running app

    I had a working program (Windows Forms Project) complete with buttons and the underlying code.

    In an attempt to shortcut my work I decided to add tab controls and move everything in my main form into tab 1 (cut and pasted).
    As you can imagine it didn't work. I then got rid of the tab conrol and pasted everything back into the main form but the program doesn't work anymore.
    Can someone tell me what's wrong please?

    I'm working in MS V studio 2008 express
    Thanks.
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

  2. #2
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    612
    Apart from the non use of source / version control, you're going to have to expound on the details slightly more to get any useful reponses.

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    If you copy controls the event-code won't follow.
    If you copy the event-code the controls won't follow.
    You have to copy both, but even then it's kinda risky just to copy and expect it to work.
    Keep backups!
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    Registered User
    Join Date
    Mar 2009
    Location
    england
    Posts
    209
    Sounds like in dragging/dropping the buttons onto a tab page, VS will have deleted the button click event associations. Check in each of the button event properties to ensure the click events are still linked to the appropriate function.

  5. #5
    The Programming Dutchman
    Join Date
    Jan 2008
    Posts
    55
    maybe you can get the code of your original form1.designer file there are all the controls declared in your project and there are also the event declared if i remember right, (correct me if i am wrong).

    this is the code of a old form.desginer.cs file of one of my C# project maybe it can help you:
    Code:
    namespace Pong
    {
        partial class frmMain
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
    
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            #region Windows Form Designer generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.components = new System.ComponentModel.Container();
                this.Timer = new System.Windows.Forms.Timer(this.components);
                this.SuspendLayout();
                // 
                // Timer
                // 
                this.Timer.Tick += new System.EventHandler(this.Timer_Tick);
                // 
                // frmMain
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(390, 326);
                this.Name = "frmMain";
                this.Text = "Form1";
                this.Load += new System.EventHandler(this.frmMain_Load);
                this.ResumeLayout(false);
    
            }
    
            #endregion
    
            private System.Windows.Forms.Timer Timer;
        }
    }
    Good Luck,

    Jelte.
    Last edited by Jelte; 08-05-2009 at 12:11 PM.
    The Programming Dutchman

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Controls Style: Resource View vs Running App
    By devGordon in forum Windows Programming
    Replies: 4
    Last Post: 06-19-2009, 10:43 PM
  2. Monitor That Another App is Running
    By CodeButcher in forum Windows Programming
    Replies: 1
    Last Post: 01-18-2007, 01:34 PM
  3. multithreading question
    By ichijoji in forum C++ Programming
    Replies: 7
    Last Post: 04-12-2005, 11:59 PM
  4. Running Programs from my app
    By Megatron in forum Windows Programming
    Replies: 2
    Last Post: 02-25-2002, 04:04 PM
  5. Bringing focus to an window if app already running.
    By Unregistered in forum Windows Programming
    Replies: 2
    Last Post: 01-24-2002, 02:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21