I am writing in vb.net (2013). My form looks different in the IDE than in run-time when using Windows 10. I tried using the EnableVisualStyles command with no apparent success.
The first picture shows the form in my IDE, the second shows the form in run-time compared to the form using the EnableVisualStyle command.
I appreciate any help you can give.
Thanks!
Forms with and without EnableVisualStyles
Below is the code for the form with EnableVisualStyles:
Imports System
Imports System.Drawing
Imports System.Windows.Forms
'Summary description for Form1.
Public Class vsForm
Inherits System.Windows.Forms.Form
Private button1 As System.Windows.Forms.Button
<System.STAThread()> _
Public Shared Sub Main()
System.Windows.Forms.Application.EnableVisualStyles()
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"
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.Fixed3D
End Sub 'New
End Class 'Form1