Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi everybody,

I want have a control like "Date and Time Settings" dialog of windows that there are a textbox and inside it small arrows, also we can set time or date with up_down arrow on keyboard.

If clear this describe please help me for the issue.

Thanks in advanced.
Posted

Probably not, not what comes with .NET in the GAC. Look at this one: http://datetimepickerwpf.codeplex.com/[^].

—SA
 
Share this answer
 
Comments
hzawary 16-May-12 15:04pm    
I glad to conversation with you again:)
So, there are a picker? I create with it a time picker for myself.
Sergey Alexandrovich Kryukov 16-May-12 15:20pm    
Yes, there is a time picker? What's the question? I think it's good enough for your purpose.
--SA
hzawary 16-May-12 15:37pm    
My purpose is about, exist a public picker control that I develop it.
Sergey Alexandrovich Kryukov 17-May-12 16:28pm    
You phrasing is not correct enough to be understood. I pointed out a picker project for you to use. Is it a problem? If you want to develop one, again, what's the problem? -- develop it.
--SA
Wendelius 16-May-12 15:14pm    
Good link
You can use several of my spinner/up-down control to create such a control:

see Numeric Up/Down Textbox that Inherits from TextBox[^]

YOu can either do the above, or modify the code to do what you want.
 
Share this answer
 
Comments
hzawary 18-May-12 3:15am    
Well done, but I have a micro problem with it, when I press and hold the arrow (Up/Down) no change numbers in the box! you can update your beautiful code;)
hzawary 18-May-12 3:33am    
Of course! I did can write this program, but didn't it because two resons:
1-I was hoping, exist the control in toolbox of VS (.NET 3.5 or lower)
2-I have not time for this job!
For GeT Time

C#
System.DateTime time = System.DateTime.Now;

            int hour = time.Hour;
            int minute = time.Minute;
            int second = time.Second;
            int day = time.Day;
            int month = time.Month;
            int year = time.Year;
            string dayofweek = time.ToString("dddd");



            textBox1.Text = hour.ToString();
            textBox2.Text = minute.ToString();
            textBox3.Text = second.ToString();
            textBox4.Text = day.ToString();
            textBox5.Text = month.ToString();
            textBox6.Text = year.ToString();
            textBox13.Text = dayofweek.ToString();



For SeT Time

C#
SystemTime newtime = new SystemTime();
            {
                string year = textBox12.Text;
                ushort yearOut = Convert.ToUInt16(year);
                newtime.Year = (ushort)yearOut;

                string month = textBox11.Text;
                ushort monthOut = Convert.ToUInt16(month);
                newtime.Month = (ushort)monthOut;

                string day = textBox10.Text;
                ushort dayOut = Convert.ToUInt16(day);
                newtime.Day = (ushort)dayOut;

                string hour = textBox7.Text;
                ushort hourOut = Convert.ToUInt16(hour);
                newtime.Hour = (ushort)hourOut;

                string minute = textBox8.Text;
                ushort minuteOut = Convert.ToUInt16(minute);
                newtime.Minute = (ushort)minuteOut;

                string second = textBox9.Text;
                ushort secondOut = Convert.ToUInt16(second);
                newtime.Second = (ushort)secondOut;
            }


            Win32SetSystemTime(ref newtime);


I wish that code help you
 
Share this answer
 
Comments
hzawary 18-May-12 3:04am    
Thank you, but you didn't see carefully to my problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900