|
Refering below, will the code in finally block be executed even if a return is called in the try block?
void Somefunc()
{
try {
.
.
return;
}
catch(Exception) {
.
.
}
finally {
.
SomeCode();
}
}
<font=arial>Weiye Chen
Give me the Death Note, and I'll cleanse the world...
|
|
|
|
|
hey!!
ru testing us
Regards,
Bhupi Bhai.
|
|
|
|
|
Bhupi Bhai wrote: ru testing us
I dont think i would be so free to do such things. Anyway i was trying to confirm if finally would be called, but i seem to forgot that i could easiy test it out.
Regardless i saw a link[^] about this. Just for anyone who is interested.
<font=arial>Weiye Chen
Give me the Death Note, and I'll cleanse the world...
|
|
|
|
|
hahhahaa
nice one but you should answer him cz maybe he is knew on C#.
The answer is that the finally clause is executed in all the senarios
good luck
|
|
|
|
|
|
It is. The purpose of a finally block is to guarantee that a piece of code will be run, regardless of what else happens in the try catch block. This gives you the ability to guarantee that cleanup code will be carried out.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Can we add treenodes i.e nodes which again has nodes in them to a combobox instead of a sequential list of items in C#
Thanks
|
|
|
|
|
U will have to create a custom control for this.
u cant use the combo box control.
|
|
|
|
|
You can have a look at this article. ComboBoxTree[^]
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
Experience is like a comb that life gives you when you are bald - Navjot Singh Sidhu
|
|
|
|
|
I want to backup SQL SERVER 2000 database and zip it using .NET 1.1 . The application must be connect remote system by using windows authentication is there any website to produce the code in .NET 1.1 in any language(c#.net or vb.net)
this is haneef
|
|
|
|
|
Please don't paste your entite question in the subject field. I see that you have done this with most of your questions since your arrived. The subject is supposed to be a short description of the content of the post.
The people who offer advice here do it on their spare time out of the goodness of their hearts. If you don't make any effort to make your post easy to read, they will feel that you don't appreciate their effort, and will not bother to read it.
---
b { font-weight: normal; }
|
|
|
|
|
Thank u Guffa;)
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
dont take it personally!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi all,
I have 4 months of experience in C# windows development. i wish to go for MCTS(Microsoft certified technology specialist) certification in C# windows development.
please send me the links, resources and how to prepare for the test. Also, if possible anyone who gave this exam, can share his/her experience.
Thanks in advance
Praveen Raghuvanshi
Software Engineer,
Wins Infotek Pvt. LTd.
Technopark, Trivandrum
India.
|
|
|
|
|
praveen raghuvanshi wrote: please send me the links, resources and how to prepare for the test
Have you looked at the Microsoft site?
|
|
|
|
|
Friends,
How do i handle the event when window is minimized to the taskbar by clicking the minimize button. Also i want to handle the event when user clicks taskbar button to maximize it. I cant find these events in events window.
Imtiaz
|
|
|
|
|
You have to use the Activated event and in that check the windowstate of the form.
Hope that works for u...
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
hi
this wont work cz it is only fired when the form comes to the active mode from the inactive mode which is not the case here.
|
|
|
|
|
hi,
I think you shuld use the sizeChanged event which is fired whenever the size of the form changes.
in the sizeChanged event you should add the following code
<br />
if(this.Size == this.MaximumSize)<br />
<br />
if(this.Size == this.MinimumSize)<br />
good luck
|
|
|
|
|
The shortest way to do is :
In the Form Resize event check for "FormWindowState".
Eg:
private void Form1_Resize(object sender, System.EventArgs e)
{
if (FormWindowState.Minimized == WindowState)
{
//Your code ..
}
}
Regards,
Bhupi Bhai.
|
|
|
|
|
Hi, I have a MenuItem. There is a "File" MenuItem. "File" has a number of sub-menus (ToolStripMenuItem) which are "New" , "Log-out" and "Exit". The problem is:
I can't find a way how to disable "New" or "Log-out" or "Exit".
using this syntax :
mainFormObj.menuStrip1.Items[0].disable = true;
only disable the "File" menu. But:
using this syntax :
mainFormObj.menuStrip1.Items[0][0].disable = true;
is wrong, and this syntax :
mainFormObj.menuStrip1.Items[0].items[0].disable = true;
is wrong too...
Anyone can find how? and thankx for the help.
-- modified at 0:57 Monday 11th December, 2006
-- modified at 0:58 Monday 11th December, 2006
Enjoy It!
|
|
|
|
|
all you need to do is disable it like you would a regular button
if i have a menuitem that is called "exitToolStripMenuItem" i would just write
exitToolStripMenuItem.Enabled = false;
hope this helps
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
wow, thanks a lot!
Enjoy It!
|
|
|
|
|
Is it possible to use c# class to vb web project as it is???//
DaVe
|
|
|
|