Click here to Skip to main content
15,891,431 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Changing the label text property with code. Pin
Аslam Iqbal26-Feb-12 17:24
professionalАslam Iqbal26-Feb-12 17:24 
AnswerRe: Changing the label text property with code. Pin
Clark Kent12328-Feb-12 9:33
professionalClark Kent12328-Feb-12 9:33 
QuestionHow to check the Status of Printer directly connected to COM port Pin
singhsunil1325-Feb-12 0:08
singhsunil1325-Feb-12 0:08 
AnswerRe: How to check the Status of Printer directly connected to COM port Pin
Dave Kreskowiak25-Feb-12 6:16
mveDave Kreskowiak25-Feb-12 6:16 
GeneralRe: How to check the Status of Printer directly connected to COM port Pin
singhsunil1325-Feb-12 20:51
singhsunil1325-Feb-12 20:51 
AnswerRe: How to check the Status of Printer directly connected to COM port Pin
Luc Pattyn26-Feb-12 3:00
sitebuilderLuc Pattyn26-Feb-12 3:00 
Questionhow to close a form instantly Pin
alejx23-Feb-12 16:35
alejx23-Feb-12 16:35 
AnswerRe: how to close a form instantly Pin
Luc Pattyn23-Feb-12 17:18
sitebuilderLuc Pattyn23-Feb-12 17:18 
Assuming you are talking about WinForms, and sub s1 is called from inside some handler (say a button click handler) that behavior is what they intended it to be. Form.Close() does not actually close the Form, it merely queues a request to close the Form; which will be handled when the main thread (on which your button click handler is executing right now) gets around to it. And even then, it will first fire a FormClosing event, and then close the Form, and finally fire the FormClosed event. This is a common pattern in Windows and its event mechanism.

What you could do inside function f1 is either not catch the exception, or throw a new one; and then try-catch in sub s1 and do (or not do) as you please.

Please keep in mind that often functions are supposed to calculate something and return the result, and NOT to cause side effects (such as closing a Form). When you deviate from that, you have to take full responsibility and bear the consequences.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

QuestionSuggestion for try...Catch block Pin
alejx23-Feb-12 10:23
alejx23-Feb-12 10:23 
AnswerRe: Suggestion for try...Catch block Pin
Luc Pattyn23-Feb-12 17:30
sitebuilderLuc Pattyn23-Feb-12 17:30 
GeneralRe: Suggestion for try...Catch block Pin
alejx24-Feb-12 1:57
alejx24-Feb-12 1:57 
GeneralRe: Suggestion for try...Catch block Pin
Eddy Vluggen24-Feb-12 9:49
professionalEddy Vluggen24-Feb-12 9:49 
GeneralRe: Suggestion for try...Catch block Pin
alejx25-Feb-12 7:46
alejx25-Feb-12 7:46 
GeneralRe: Suggestion for try...Catch block Pin
Eddy Vluggen25-Feb-12 8:27
professionalEddy Vluggen25-Feb-12 8:27 
GeneralRe: Suggestion for try...Catch block Pin
alejx25-Feb-12 8:34
alejx25-Feb-12 8:34 
GeneralRe: Suggestion for try...Catch block Pin
Eddy Vluggen25-Feb-12 8:41
professionalEddy Vluggen25-Feb-12 8:41 
QuestionRunning Photoshop Action Pin
Pasan14822-Feb-12 5:24
Pasan14822-Feb-12 5:24 
AnswerRe: Running Photoshop Action Pin
Simon_Whale22-Feb-12 6:06
Simon_Whale22-Feb-12 6:06 
GeneralRe: Running Photoshop Action Pin
Pasan14822-Feb-12 6:37
Pasan14822-Feb-12 6:37 
AnswerRe: Running Photoshop Action Pin
Eddy Vluggen23-Feb-12 8:46
professionalEddy Vluggen23-Feb-12 8:46 
GeneralRe: Running Photoshop Action Pin
Agecanonix23-Feb-12 10:51
Agecanonix23-Feb-12 10:51 
GeneralRe: Running Photoshop Action Pin
Dave Kreskowiak23-Feb-12 12:22
mveDave Kreskowiak23-Feb-12 12:22 
GeneralRe: Running Photoshop Action Pin
Pasan14824-Feb-12 4:36
Pasan14824-Feb-12 4:36 
Questionpassing value from popup to column gridview Pin
C#Coudou20-Feb-12 22:49
C#Coudou20-Feb-12 22:49 
QuestionLoad Connection String from a File Pin
Midnight Ahri20-Feb-12 16:14
Midnight Ahri20-Feb-12 16:14 

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.