Click here to Skip to main content
15,910,009 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Downloader Pin
Heath Stewart21-Sep-04 11:16
protectorHeath Stewart21-Sep-04 11:16 
GeneralRe: C# Downloader Pin
shiraztk21-Sep-04 18:03
shiraztk21-Sep-04 18:03 
GeneralRe: C# Downloader Pin
Heath Stewart22-Sep-04 6:46
protectorHeath Stewart22-Sep-04 6:46 
GeneralDatabase access freezing main application Pin
Jon G21-Sep-04 6:02
Jon G21-Sep-04 6:02 
GeneralRe: Database access freezing main application Pin
Nick Parker21-Sep-04 6:56
protectorNick Parker21-Sep-04 6:56 
GeneralRe: Database access freezing main application Pin
Jon G21-Sep-04 7:09
Jon G21-Sep-04 7:09 
GeneralSubscribing multiple forms to a single Resize event Pin
Bisbal21-Sep-04 5:16
sussBisbal21-Sep-04 5:16 
GeneralRe: Subscribing multiple forms to a single Resize event Pin
Heath Stewart21-Sep-04 7:08
protectorHeath Stewart21-Sep-04 7:08 
In order to attach a handler, you would have to cast client to your Form type and make sure the handler is accessible (i.e., not private - use internal, perhaps).

When handling events in controls and forms, however, it's better to override the event handlers that are already present. So, if you needed to handle the Resize, it's better to override OnResize:
protected override void OnResize(EventArgs e)
{
  // Handle the event and optionally call...
  base.OnResize(e);
}
This has less overhead and gives you a greater amount of control over what happens when an event is fired (because your override is actually called before firing the event; calling base.OnEventName is what eventually may fire the event).

With this in mind, you might consider extending all your MDI child forms from a single class that implements this resizing behavior. That would be a good object-oriented design.

Even if this single base class must delegate resizing code to its MDI parent (perhaps the MDI parent contains information that the MDI children can't access), you must still make sure that the handler is accessible and implementing this code in a single base class makes for a better OO design.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles]
GeneralRe: Subscribing multiple forms to a single Resize event Pin
Bisbal22-Sep-04 4:46
sussBisbal22-Sep-04 4:46 
GeneralSubscribing multiple forms to a single Resize event Pin
Anonymous21-Sep-04 5:15
Anonymous21-Sep-04 5:15 
GeneralDATAGRID INDEX .There are some mistakes. Please help.Im having a heck of a time Pin
macsgirl21-Sep-04 5:08
macsgirl21-Sep-04 5:08 
QuestionHow to change the color of status bar? Pin
kaalpu21-Sep-04 4:45
kaalpu21-Sep-04 4:45 
GeneralExtreme memory consumption when launching multiple controls in Panel Pin
Magnus Green21-Sep-04 4:20
Magnus Green21-Sep-04 4:20 
GeneralRe: Extreme memory consumption when launching multiple controls in Panel Pin
Heath Stewart21-Sep-04 7:02
protectorHeath Stewart21-Sep-04 7:02 
GeneralRe: Extreme memory consumption when launching multiple controls in Panel Pin
Magnus Green22-Sep-04 1:36
Magnus Green22-Sep-04 1:36 
GeneralRe: Extreme memory consumption when launching multiple controls in Panel Pin
Heath Stewart22-Sep-04 6:53
protectorHeath Stewart22-Sep-04 6:53 
GeneralRemoving the cross from a form Pin
exhaulted21-Sep-04 4:16
exhaulted21-Sep-04 4:16 
GeneralRe: Removing the cross from a form Pin
Joel Lucsy21-Sep-04 5:37
Joel Lucsy21-Sep-04 5:37 
GeneralRe: Removing the cross from a form Pin
exhaulted21-Sep-04 5:46
exhaulted21-Sep-04 5:46 
GeneralRe: Removing the cross from a form Pin
Joel Lucsy21-Sep-04 5:53
Joel Lucsy21-Sep-04 5:53 
GeneralRe: Removing the cross from a form Pin
exhaulted21-Sep-04 6:27
exhaulted21-Sep-04 6:27 
GeneralRe: Removing the cross from a form Pin
Stefan Troschuetz21-Sep-04 8:16
Stefan Troschuetz21-Sep-04 8:16 
GeneralRe: Removing the cross from a form Pin
exhaulted21-Sep-04 21:44
exhaulted21-Sep-04 21:44 
GeneralRe: Removing the cross from a form Pin
Stefan Troschuetz21-Sep-04 22:02
Stefan Troschuetz21-Sep-04 22:02 
GeneralRe: Removing the cross from a form Pin
exhaulted22-Sep-04 1:40
exhaulted22-Sep-04 1:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.