"Terry Olsen" <to******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
They don't appear black. The command buttons and radio buttons I put on
the tab page are displayed as they appear in Windows 2000 and below. I
have the FlatStyle set to System but that doesn't help. The wierd thing
is that the textboxes that I put on the tab page DO appear as XP themed
controls.
Terry, I was going to post and say that this sort of stuff is fixed in VS
2005 (I know they did a lot of work with themes in .NET 2.0). But I just
threw together a 2003 project to see the issue and everything on my tab page
is XP themed...? Although I've read, using themes in 1.1 can lead to a
world of hurt. :)
I changed Button1 and Radiobutton1's FlatStyle to System and launched the
form from a Sub Main after enabling visual styles.
Can you duplicate with my posted code?
Greg
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.TabControl1 = New System.Windows.Forms.TabControl
Me.TabPage1 = New System.Windows.Forms.TabPage
Me.Button1 = New System.Windows.Forms.Button
Me.RadioButton1 = New System.Windows.Forms.RadioButton
Me.Button2 = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.TabControl1.SuspendLayout()
Me.TabPage1.SuspendLayout()
Me.SuspendLayout()
'
'TabControl1
'
Me.TabControl1.Controls.Add(Me.TabPage1)
Me.TabControl1.Location = New System.Drawing.Point(40, 32)
Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 0
Me.TabControl1.Size = New System.Drawing.Size(456, 352)
Me.TabControl1.TabIndex = 0
'
'TabPage1
'
Me.TabPage1.Controls.Add(Me.TextBox1)
Me.TabPage1.Controls.Add(Me.Button1)
Me.TabPage1.Controls.Add(Me.RadioButton1)
Me.TabPage1.Location = New System.Drawing.Point(4, 22)
Me.TabPage1.Name = "TabPage1"
Me.TabPage1.Size = New System.Drawing.Size(448, 326)
Me.TabPage1.TabIndex = 0
Me.TabPage1.Text = "TabPage1"
'
'Button1
'
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.Button1.Location = New System.Drawing.Point(24, 72)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 1
Me.Button1.Text = "Button1"
'
'RadioButton1
'
Me.RadioButton1.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.RadioButton1.Location = New System.Drawing.Point(24, 32)
Me.RadioButton1.Name = "RadioButton1"
Me.RadioButton1.TabIndex = 0
Me.RadioButton1.Text = "RadioButton1"
'
'Button2
'
Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.Button2.Location = New System.Drawing.Point(296, 416)
Me.Button2.Name = "Button2"
Me.Button2.TabIndex = 1
Me.Button2.Text = "Button2"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(24, 112)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.TabIndex = 2
Me.TextBox1.Text = "TextBox1"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(656, 478)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.TabControl1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.TabControl1.ResumeLayout(False)
Me.TabPage1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Public Shared Sub Main()
System.Windows.Forms.Application.EnableVisualStyle s()
System.Windows.Forms.Application.Run(New Form1)
End Sub 'Main
End Class