Foros del Web » Programación para mayores de 30 ;) » .NET »

habilitar estilo visual de windows xp en una aplicacion VB.NET

Estas en el tema de habilitar estilo visual de windows xp en una aplicacion VB.NET en el foro de .NET en Foros del Web. Hola, tengo problemas aplicando el estilo visual de xp en mis forms hice la prueba con un form y ello corre perfectamente, de la siguiente ...
  #1 (permalink)  
Antiguo 11/03/2005, 21:43
 
Fecha de Ingreso: noviembre-2004
Mensajes: 48
Antigüedad: 19 años, 6 meses
Puntos: 0
habilitar estilo visual de windows xp en una aplicacion VB.NET

Hola,
tengo problemas aplicando el estilo visual de xp en mis forms
hice la prueba con un form y ello corre perfectamente, de la siguiente manera
--------------
Imports System
Imports System.Drawing
Imports System.Windows.Forms

Namespace VStyles

' Summary description for Form1.
Public Class Form1
Inherits System.Windows.Forms.Form

Private button1 As System.Windows.Forms.Button

<System.STAThread()> _
Public Shared Sub Main()

System.Windows.Forms.Application.EnableVisualStyle s()
System.Windows.Forms.Application.Run(New Form1)
End Sub 'Main

Public Sub New()

Me.button1 = New System.Windows.Forms.Button()
Me.button1.Location = New System.Drawing.Point(24, 16)
Me.button1.Size = New System.Drawing.Size(120, 100)
Me.button1.FlatStyle = FlatStyle.System
Me.button1.Text = "I am themed."

' Sets up how the form should be displayed and adds the controls to the form.
Me.ClientSize = New System.Drawing.Size(300, 286)
Me.Controls.Add(Me.button1)

Me.Text = "Application.EnableVisualStyles Example"
End Sub 'New

End Class 'Form1
End Namespace 'VStyles
--------------------

pero esta vaina no funciona cuando lo aplico a mi codigo que inicia desde un modulo asi:

----------------------------
Imports System
Imports System.Drawing
Imports System.Windows.Forms

Module modPrincipal
Public Sub main()
System.Windows.Forms.Application.EnableVisualStyle s()
Dim ofrmPrincipal As New frmPrincipal
inicializarBD()
ofrmPrincipal.Show()
If FECHAACTUAL <> Now.Today Then
Dim ofrmParametros As New frmParametros
If ofrmParametros.ShowDialog() = DialogResult.Cancel Then
ofrmPrincipal.Close()
Else
Application.Run(ofrmPrincipal)
End If
Else
Application.Run(ofrmPrincipal) ' <-- my code crash here(1)
End If
End Sub
End Module
-------------------

inicia bien la palicacion pero se tira cuando muestro un dialogo y lo ciero, se tira justamente en (1) con la siguiente excepcion

Excepción no controlada del tipo 'System.Runtime.InteropServices.SEHException' en system.windows.forms.dll
Información adicional: Un componente externo inició una excepción.

Alguien sabe como puedo solucionar esto? porfa, estoy con el visual studio .NET 2003
  #2 (permalink)  
Antiguo 23/03/2005, 21:57
 
Fecha de Ingreso: noviembre-2004
Mensajes: 48
Antigüedad: 19 años, 6 meses
Puntos: 0
Decidi cargar todos mis forms desde mi formulario principal.... en load. Eso soluciono todo.

Ahora mi applicacion tiene el estilo visual xp sin hacer casi nada.

chao
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:26.