DateTimePicker in VS2005

  • Thread starter Thread starter Brian Smith
  • Start date Start date
B

Brian Smith

When I drop a standard DateTimePicker onto a form in VS2005 it displays
in a Flat XP-style, even though it does not appear to have any
properties relating to this. But when the application runs, it reverts
to the old 3D look. What do I have to do to retain the Flat look?

brian smith
 
When I drop a standard DateTimePicker onto a form in VS2005 it displays
in a Flat XP-style, even though it does not appear to have any
properties relating to this. But when the application runs, it reverts
to the old 3D look. What do I have to do to retain the Flat look?

brian smith

Does Program.cs in your project look like the code below?

*****

using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace TestWindow
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MdiMain());
}
}
}

*****

If not add the missing code to the Main() method.


Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
 
Brilliant. Many thanks Otis.

brian smith


Otis said:
When I drop a standard DateTimePicker onto a form in VS2005 it displays
in a Flat XP-style, even though it does not appear to have any
properties relating to this. But when the application runs, it reverts
to the old 3D look. What do I have to do to retain the Flat look?

brian smith

Does Program.cs in your project look like the code below?

*****

using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace TestWindow
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MdiMain());
}
}
}

*****

If not add the missing code to the Main() method.


Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
 
Back
Top