Link to home
Start Free TrialLog in
Avatar of jczander
jczander

asked on

C# Formatting a Control Globally

I have a program that will have a lot of datetime pickers on the interface. This is a time keeping application so I need a lot of these controls formatted as follows:

this.tpTimePicker1.CustomFormat = "hh:mm tt";
this.tpTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.tpTimePicker1.ShowUpDown = true;

Open in new window


I would prefer to not have to put this code in every time I have one of these controls. I'm thinking there has to be a way to create a global control/formatting so I can just use instances of the modified control.

Anyone know how to do this?

C#/Winforms/Studio2013
SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jczander
jczander

ASKER

Excellent. Thanks a bunhc