Thứ Năm, 8 tháng 12, 2011

// // Leave a Comment

Hàm tương đương SetForegroundWindow trong C#.NET

Many Win32 programmers find dificult to find the equivalent of Win32 API Functions

As result of that, they don't find the right equivalent and try to use the API by loading a dll and finding the desired function or even worse they do ugly alternative things instead of using the right .NET function.


Here is the SetForegroundWindow equivalent:

form.Activate();
I have seen people doing weird things like:

this.TopMost = true;
this.Focus();
this.BringToFront();
this.TopMost = false;

0 comments: