problems in tool bar display
-
recently i posted a question as follows --------------------------------------- i am using toolbar component .net ver 2 (not toolstrip) in vb.net 2005. if i give application.enablevisualstyle command to enable xp style interface then icons on my toolbar will not come. if i disabel xp visual style it will come? how can i show this toolbar in xp style settings? pls help me.... This is the answer which i got ------------------------------ This is a bug in the .NET framework. You can work-around it by calling Application.DoEvents() after EnableVisualStyles. i tried this, but its not working, after this also i can't see toolbar icons, i can see only deviders, can u please explain me to solve this problem... with thanks ajo:(
-
recently i posted a question as follows --------------------------------------- i am using toolbar component .net ver 2 (not toolstrip) in vb.net 2005. if i give application.enablevisualstyle command to enable xp style interface then icons on my toolbar will not come. if i disabel xp visual style it will come? how can i show this toolbar in xp style settings? pls help me.... This is the answer which i got ------------------------------ This is a bug in the .NET framework. You can work-around it by calling Application.DoEvents() after EnableVisualStyles. i tried this, but its not working, after this also i can't see toolbar icons, i can see only deviders, can u please explain me to solve this problem... with thanks ajo:(
You should enable visual styles in a Main function, before your form gets loaded, then call DoEvents(). I recommend that you create a Main class and add the Main method there as shown below.
Public Class Main
Public Shared Sub Main(ByVal args() As String)
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MyForm)
End Sub
End ClassNext, you need to change your project setting's Startup Object to "Sub Main". You can find this option by right clicking your project in the solution explorer, click on Properties, select CommonProperties\General in the dialog's tree.