Results 1 to 11 of 11

Thread: [RESOLVED] Form Rezize don't fire

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    155

    Resolved [RESOLVED] Form Rezize don't fire

    Hi:
    Can someone help?
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    
    namespace WindowsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
            private void Form1_Resize(object sender, System.EventArgs e)
            {
                Console.WriteLine("FFF");
    
            }
    
        }
    }
    I tried, the Form1_Resize Event never fire, Why?

  2. #2
    Fanatic Member BillBoeBaggins's Avatar
    Join Date
    Jan 2003
    Location
    in your database, dropping your tables.
    Posts
    628

    Re: Form Rezize don't fire

    Code:
    this.Resize =+ new EventHandler(Resize, Form1_Resize)
    This above code is not perfectly right, but my C# is rusty. Basically you need to associate your event handler, with the objects event.

  3. #3
    Fanatic Member BillBoeBaggins's Avatar
    Join Date
    Jan 2003
    Location
    in your database, dropping your tables.
    Posts
    628

  4. #4
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: Form Rezize don't fire

    Which you don't even need to write any code to do. Just make sure that your Form1_Resize method is associated with your form's Resize event in your Properties window while in Design Mode.

    Also what window are you looking in for the output?

  5. #5
    Fanatic Member BillBoeBaggins's Avatar
    Join Date
    Jan 2003
    Location
    in your database, dropping your tables.
    Posts
    628

    Re: Form Rezize don't fire

    Quote Originally Posted by nmadd
    Which you don't even need to write any code to do. Just make sure that your Form1_Resize method is associated with your form's Resize event in your Properties window while in Design Mode.
    A)This would require that the development platform he is usings does this.
    B)I believe the code is written anyways, just under the InitializeComponent() section.

  6. #6
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: Form Rezize don't fire

    Quote Originally Posted by BillBoeBaggins
    A)This would require that the development platform he is usings does this.
    B)I believe the code is written anyways, just under the InitializeComponent() section.
    A) Okay, he didn't specify. But I think that the number of people that do not use some version of Visual Studio for their C# programming is probably very, very small.
    B) It is: automatically by the Windows Form Designer when you add an event handler in Design Mode.

    There's no reason not to do it the easy way if it fits your needs.

  7. #7
    Fanatic Member BillBoeBaggins's Avatar
    Join Date
    Jan 2003
    Location
    in your database, dropping your tables.
    Posts
    628

    Re: Form Rezize don't fire

    Quote Originally Posted by nmadd
    There's no reason not to do it the easy way if it fits your needs.
    Too true, but to learn it, code it. Just my opinion.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    155

    Re: Form Rezize don't fire

    Quote Originally Posted by nmadd
    A) Okay, he didn't specify. But I think that the number of people that do not use some version of Visual Studio for their C# programming is probably very, very small.
    B) It is: automatically by the Windows Form Designer when you add an event handler in Design Mode.

    There's no reason not to do it the easy way if it fits your needs.
    Which Version? I'm using VS 2005 Standard Edition. I thot it should behave like VB2005, where the neccessary event had been added on.

    Can you clarify ?

  9. #9
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: Form Rezize don't fire

    It will add the necessary code for you in the Windows Form Designer automatically originally add the method by double-clicking on the name in the Properties window.

    Just confirm that you didn't delete the handler by accident.

    In Design Mode click on your form.
    Open the Properties window (by hitting F4).
    Click on the Events button at the top of the window.
    Confirm that your method is located next to your form's Resize event.

    If it is there then your method is firing. You can also look in the form designer code to see that a line like Bilboe posted is there.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    155

    Re: Form Rezize don't fire

    Do you meant I should be able to see it at the Members Drop Down Menu?

    "Click on the Events button at the top of the window" Is that what you meant, if yes than I do see it.


    Well I do not know how to paste a picture otherwise I show you the print screen.

    I can not locate the Events Button.

    Thanks Please help

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    155

    Re: Form Rezize don't fire

    Thanks nmadd. I got it.

Posting Permissions

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



Click Here to Expand Forum to Full Width