|
-
Aug 24th, 2007, 11:59 AM
#1
Thread Starter
Addicted Member
[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?
-
Aug 24th, 2007, 12:30 PM
#2
Fanatic Member
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.
-
Aug 24th, 2007, 12:33 PM
#3
Fanatic Member
Re: Form Rezize don't fire
-
Aug 24th, 2007, 12:47 PM
#4
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?
-
Aug 24th, 2007, 01:06 PM
#5
Fanatic Member
Re: Form Rezize don't fire
 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.
-
Aug 24th, 2007, 01:24 PM
#6
Re: Form Rezize don't fire
 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.
-
Aug 24th, 2007, 01:38 PM
#7
Fanatic Member
Re: Form Rezize don't fire
 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.
-
Aug 25th, 2007, 09:48 AM
#8
Thread Starter
Addicted Member
Re: Form Rezize don't fire
 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 ?
-
Aug 25th, 2007, 10:14 AM
#9
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.
-
Aug 25th, 2007, 10:32 AM
#10
Thread Starter
Addicted Member
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
-
Aug 25th, 2007, 11:02 AM
#11
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|