2 Quick Questions - Easy

FalconDEW

Freshman
Joined
Sep 18, 2003
Messages
42
Hi all -

I'm currently trying to research a few quick things I am trying to implement, and while I continue - I thought there may be a faster turnaround time if I just post my questions here.

1. In VB.NET how do you tap into the program exit event? I want to code a few things to happen whenever the program is exited or terminated.

2. I have 2 text box fields that I want to have a sort of 'or' relationship. i.e. when somebody enters data into one, the other is disabled - and vice versa. I'm not sure what the best event is to do this - whether it's on entry, or leaving, etc. I was wondering what the best method for doing this was.

Thanks for any help anybody can supply!

-Falcon
 
Ok - I figured out #1 using the .closing event. However, any advice for #2 would still be greatly appreciated! Thanks.

-Falcon
 
1. You can use Closing or Closed, most of your cleanup can be done in Closing, of course it is triggered first.

2. there are a few to use, it really depends on you want to handle this, you can use enter, keypress, or even one of the mouse events. For this one I wouldn't use the Leaving event, because the user should be aware that that textbox (the one you will hide) is no longer available as he either types or enters the txtbox he's in. I think I would use the TextChanged event.

What's best is it depends on you.
 
Robby - thanks a lot! I know that seemed simple, but the advice for the TextChanged event really got me going in the right direction.

I've figured out both of my problems. Thanks!
 
Back
Top