I'm creating a userform which i want to display the date and time
in the corner. The problem i'm facing now is that the date and
time refreshes whenever i click it. I want it to function like a
digital clock.
Give this a try. Right-click the UserForm's ToolBox and select "Additional
Controls" from the popup menu that appears. Scroll down to "Microsoft Status
Bar Control 6.0" and select it. This will add the "Status Bar" control to
the Toolbox. Place a "Status Bar" control on your UserForm. Highlight
(select) and click on the Custom property in the Properties window and click
on the button with the "three-dots" caption. You can play around with adding
panels and what not, but for your requested option, click on the Panels tab.
One panel should already exist on the "Status Bar" by default. Change that
panel's Alignment property to 2-sbrRight, Style property to 5-sbrTime and
AutoSize property to 1-sbrSprint. Hit OK and watch the displayed time change
automatically.
Rick