none
date and time RRS feed

  • Question

  • Hi.I fill the textboxes by using that graphical clock and the graphical calender.I did it in php. is it possible in c sharp? 

    • Edited by Ali_Lonbar Thursday, April 18, 2019 9:02 AM
    Thursday, April 18, 2019 9:02 AM

All replies

  • If you did it in PHP it means that it is a web application. In this case, all the tricks to show the calendar and clock happen on the html side of things, by means of a combination of html attributes, css styles, and javascript code. In any case, it all happens on the client side. It won't matter what language you are using on the server side of your application. So if your server-side is written in C#, your clock and calendar will still be shown in the browser as long as the html that you are sending to the browser is the same that you were sending from PHP. Neither PHP nor C# "know" anything about these graphics, it's all in the design of the HTML page.
    Thursday, April 18, 2019 11:43 AM
    Moderator
  • There is a VB.NET solution to this that is close to what you have shown. Add the class project to your C# solution, build, add the control which will show in the toolbox.

    Here I've set some colors via the property window.

    Code to set the time

    using System;
    using System.Windows.Forms;
    
    namespace WindowsFormsApp1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                clock1.UtcOffset = 
                    TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
            }
        }
    }

    To get the current data time, .Value is a DateTime type.

    MessageBox.Show(clock1.Value.ToString());

    Then here are two in C# 

    https://www.codeproject.com/Articles/9593/Analog-clock-control-in-C

    https://www.codeproject.com/Articles/34137/An-Analog-Clock-Control


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange



    Thursday, April 18, 2019 11:58 AM
    Moderator
  • This forum is for C#-specific questions only. Please identify the UI framework you're using so it can be moved to the appropriate forum (Windows Forms, WPF, UWA, ASP.NET, etc).

    Michael Taylor http://www.michaeltaylorp3.net

    Thursday, April 18, 2019 1:58 PM
    Moderator
  • Hi

    Thank you for posting here.

    Meanwhile, I noticed that you have some other threads that not be closed. If you have solved the problem, please post "Mark as answer" to the appropriate answer.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/0771885b-edcf-4d7d-9513-ef6ddcfaccaa/swiching-panel-in-one-form?forum=winforms

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/b093a274-a0cc-4a87-aaa6-006e095c789a/radiobutton?forum=winforms​​​​​​​

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 19, 2019 6:13 AM
    Moderator