Display Taskbar Icons for Borderless Forms

Does anybody know how to do this but in vb.net?

Display Taskbar Icons for Borderless Forms
When you create a borderless form in VB (BorderStyle = 0) and make it visible to the taskbar (ShowInTaskbar = True), only the form's caption shows and the form's icon is invisible. To display the icon, you must add a system menu to the form by modifying the style. This also gives you the ability to right-click on the taskbar button and see a standard system menu, but the items in it won't work unless you subclass the form and handle the system menu Click events yourself.

Add this code to the Declarations section of a form:

 
Private Declare Function GetWindowLong Lib _
      "user32" Alias "GetWindowLongA" (ByVal hWnd _
      As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib _
      "user32" Alias "SetWindowLongA" (ByVal hWnd _
      As Long, ByVal nIndex As Long, ByVal _
      dwNewLong As Long) As Long

Private Const GWL_STYLE = (-16)
Private Const WS_SYSMENU = &H80000

Add this code to the Form_Load event:

 
Dim lStyle As Long
lStyle = GetWindowLong(hWnd, GWL_STYLE) Or _
      WS_SYSMENU
SetWindowLong hWnd, GWL_STYLE, lStyle

VectorXAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

armoghanCommented:
I have done it in VB.NET, it works fine..
I created a Form, made the FormBorderStyle = None and ShowInTaskBar = true..
Set a different Icon..

When Run, The Icon is shown in Taskbar


Dont get the problem ?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.