VS NET 2003 - controls like in Win Xp

  • Thread starter Thread starter Rado
  • Start date Start date
R

Rado

Hello.
Somewhere I read that In visual studio 2003 will be posible set in controls
e.g. : button like button in Windows Xp ......., without makeing manifest
file.
Thank for answer.
 
* Rado said:
Somewhere I read that In visual studio 2003 will be posible set in controls
e.g. : button like button in Windows Xp ......., without makeing manifest
file.

Add this code to a new code file:

\\\
Imports System.Windows.Forms

Public Class Main
Public Shared Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MainForm())
End Sub
End Class
///

Then set the project's startup object to 'Sub Main' in the project's
properties window.
 
Herfried, what is the purpose of Application.DoEvents() in your code chunk?
Is this something I should always be doing in sub main? Would it make any
difference if sub main is prescribed as STA or MTA?

Eric
 
* "Eric Sabine said:
Herfried, what is the purpose of Application.DoEvents() in your code chunk?

It's a "bugfix". If you don't use it there will be problems with images
in TreeViews and ToolBars.
Is this something I should always be doing in sub main? Would it make any
difference if sub main is prescribed as STA or MTA?

I think it must be run as STA.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
Please note there are still bugs using this with Treeview. Viewing large
icons in the treeview fails if Application.EnableVisualStyles is used at
all...
 
Back
Top