Thread: Need help to restore running app

  1. #1
    Tha 1 Sick RAT
    Join Date
    Dec 2003

    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
    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
    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
    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!

    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
    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
    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:
    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))
            #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);
                // 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);
            private System.Windows.Forms.Timer Timer;
    Good Luck,

    Last edited by Jelte; 08-05-2009 at 11:11 AM.
    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, 09: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, 10: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