Is there a way to achieve what .Net 2.0 Form::ShowWithoutActivation does in .Net 1.1?

G

gellerma

Is there a way to achieve what .Net 2.0 Form::ShowWithoutActivation
does in .Net 1.1? I am working on a project that uses .Net 1.1 and it
is not certain when we can migrate to .Net 2.0. I'd like to get the
achieve what Form::ShowWithoutActivation does within .Net 1.1

-Michael
 
G

Guest

Is there a way to achieve what .Net 2.0 Form::ShowWithoutActivation
does in .Net 1.1? I am working on a project that uses .Net 1.1 and it
is not certain when we can migrate to .Net 2.0. I'd like to get the
achieve what Form::ShowWithoutActivation does within .Net 1.1

Yes, try this:

Form form = new Form();
form.ShowInTaskbar = false;
ShowWindow( form.Handle, SW_SHOWNOACTIVATE );

And you will need the following definitions:

using System.Runtime.InteropServices;
private const int SW_SHOWNOACTIVATE = 0x04;
[DllImport ("user32.dll")]
private static extern bool ShowWindow( IntPtr hWnd, int flags );
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top