Click here to Skip to main content
15,912,400 members
Home / Discussions / C#
   

C#

 
QuestionSimulating the use of a splitter Pin
Clive D. Pottinger18-Dec-07 11:03
Clive D. Pottinger18-Dec-07 11:03 
GeneralRe: Simulating the use of a splitter Pin
DaveyM6918-Dec-07 11:35
professionalDaveyM6918-Dec-07 11:35 
GeneralRe: Simulating the use of a splitter Pin
Ravi Bhavnani18-Dec-07 11:39
professionalRavi Bhavnani18-Dec-07 11:39 
GeneralRe: Simulating the use of a splitter Pin
Ravi Bhavnani18-Dec-07 11:41
professionalRavi Bhavnani18-Dec-07 11:41 
QuestionHandler for all unhandled exceptions in a class? Pin
alanteigne18-Dec-07 9:47
alanteigne18-Dec-07 9:47 
GeneralRe: Handler for all unhandled exceptions in a class? Pin
eggsovereasy18-Dec-07 10:36
eggsovereasy18-Dec-07 10:36 
GeneralRe: Handler for all unhandled exceptions in a class? Pin
alanteigne18-Dec-07 11:56
alanteigne18-Dec-07 11:56 
GeneralRe: Handler for all unhandled exceptions in a class? Pin
martin_hughes18-Dec-07 12:14
martin_hughes18-Dec-07 12:14 
Here's an idea of what you could do (although I make no assurances as to the quality of the the design! Smile | :) ) -

In your custom form you'll need to surround any potentially error producing blocks of code in a standard try...catch block. What you'll also need in the custom class is an event, perhaps call it OnError or similar (have a google for how events are implemented in C#), and when an error is caught by the try...catch mechanism, fire off the OnError event.

Then from your main app you can subscribe to this event with something like the following:

{...

frmCustomForm = new MyCustomForm();

frmCustomForm.OnError += new EventHandler(yourMethodHere);

this.Controls.Add(frmCustomForm);

...}

private void yourMethodHere()
{
code that runs when the event is fired an recieved.

}

Now a word of warning Smile | :) It sounds as if there's a lot of logic contained in your custom form that might suit being refactored out... something for you to have a think about!

"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.

"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.


GeneralRe: Handler for all unhandled exceptions in a class? Pin
Mark Churchill18-Dec-07 14:24
Mark Churchill18-Dec-07 14:24 
GeneralRe: Handler for all unhandled exceptions in a class? Pin
Giorgi Dalakishvili18-Dec-07 19:40
mentorGiorgi Dalakishvili18-Dec-07 19:40 
GeneralRe: Handler for all unhandled exceptions in a class? Pin
alanteigne19-Dec-07 7:30
alanteigne19-Dec-07 7:30 
GeneralException Handling in Windows application. Pin
Shani Aulakh18-Dec-07 9:27
Shani Aulakh18-Dec-07 9:27 
GeneralRe: Exception Handling in Windows application. Pin
pmarfleet18-Dec-07 10:23
pmarfleet18-Dec-07 10:23 
GeneralRe: Exception Handling in Windows application. Pin
Shani Aulakh18-Dec-07 10:34
Shani Aulakh18-Dec-07 10:34 
GeneralRe: Exception Handling in Windows application. Pin
pmarfleet18-Dec-07 10:46
pmarfleet18-Dec-07 10:46 
GeneralRe: Exception Handling in Windows application. Pin
Shani Aulakh18-Dec-07 10:56
Shani Aulakh18-Dec-07 10:56 
GeneralRe: Exception Handling in Windows application. Pin
pmarfleet18-Dec-07 11:01
pmarfleet18-Dec-07 11:01 
GeneralRe: Exception Handling in Windows application. Pin
Shani Aulakh18-Dec-07 11:13
Shani Aulakh18-Dec-07 11:13 
GeneralRe: Exception Handling in Windows application. Pin
pmarfleet18-Dec-07 11:20
pmarfleet18-Dec-07 11:20 
GeneralRe: Exception Handling in Windows application. Pin
Kalvin @ Work18-Dec-07 11:16
Kalvin @ Work18-Dec-07 11:16 
GeneralRe: Exception Handling in Windows application. Pin
Shani Aulakh18-Dec-07 11:21
Shani Aulakh18-Dec-07 11:21 
GeneralpropertyGrid control Pin
netJP12L18-Dec-07 8:59
netJP12L18-Dec-07 8:59 
GeneralRe: propertyGrid control Pin
Paul Conrad24-Dec-07 19:49
professionalPaul Conrad24-Dec-07 19:49 
Questiontrackbar value Pin
#Jet18-Dec-07 8:50
#Jet18-Dec-07 8:50 
GeneralRe: trackbar value Pin
Paul Conrad24-Dec-07 19:50
professionalPaul Conrad24-Dec-07 19:50 

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.