How can I implement a smooth ProgressBar?
Refer to the following KnowledgeBase articles in MSDN: HOW TO: Create a Smooth Progress Bar in Visual C# .NET HOW TO: Create a Smooth ProgressBar in Visual Basic .NET
How can I programmatically obtain the name of the assembly that the code is executing in ?
The following code snippet demonstrates how you can obtain the name of the assembly that the code is executing in: [C#] MessageBox.Show(System.Reflection.Assembly.GetEntryAssembly().GetName().Name); [VB.NET] MessageBox.Show(System.Reflection.Assembly.GetEnTryAssembly().GetName().Name)
I add my application to the Window’s Tray, set ShowInTaskBar to false, but the program still appears in the Alt+Tab list.
An easy way to keep the program from appearing in the Alt+Tab list is to set the Form’s FormBorderStyle property to be a ToolWindow (fixed or sizable). One caveat to this is that if you display another Form (that is not a ToolWindow) through a call in your application, the main Form will again appear in the Alt+Tab listing. To get around this, you can make all of the Forms in your Tray application have a FormBorderStyle of ToolWindow.
I call invoke Abort on my threads, but they still do not terminate.
There are several possible reasons for this. Invoking Abort on a suspended thread will have no effect until the thread is resumed. Once it is resumed, then the Abort will be carried out. Also, when closing your application, you can make sure that the secondary threads are terminated by calling Join (myWorkerThread.Join) immediately after invoking Abort on the thread. For instance, this would be necessary if the thread is in the middle of an intensive operation, or even if it is simply sleeping.
When I close my application, my secondary thread does not exit.
In most cases, this can be resolved by making the thread a background thread through it’s IsBackground property. By default, managed threads are created as foreground threads, while unmanaged threads are created as background threads. When all of the foreground threads in an application have terminated, the CLR invokes Abort on the background threads that are still running.