 |
|
 |
This is an outstanding control - great job. Thank you for sharing it.
|
|
|
|
 |
|
 |
I like the work you did with the clock. it's fantastic.
|
|
|
|
 |
|
 |
Hi,
By using the SriClocks.dll, and by using the following code lines, I can use this in my own form, when I start the project in Visual Studio.
public Form1()
{
InitializeComponent();
SriClocks.DigitalClockCtrl clk = new DigitalClockCtrl();
clk.Size = new Size(500, 150);
clk.Show();
this.Controls.Add(clk);
clk.SetDigitalColor = DigitalColor.GreenColor;
}
But when I'm using Expression Blend to start the project, I don't have the Controls available to add the clock. Can someone please let me know how to Add a custom control like this, in Expression Blend
Thanks in advance.
|
|
|
|
 |
|
 |
I place the clock on the form - it is of the size that is smaller than the one you are using as an exmple (not sure if it matters).
Then I display the form with myForm.ShowDialog
When I dismiss the form by a button click I immediately get an error. Below is the code and the location of the error:
internal void DrawColon(Graphics g, ColonType type, bool dim)
{
pen.Width = dimPen.Width = linewidth;
Pen p = (dim) ? dimPen : pen; // choose a pen for blinking
switch(type)
{
case ColonType.Circular:
g.DrawEllipse(p, colonRect1);
g.DrawEllipse(p, colonRect2);
break;
case ColonType.Rectangular:
g.DrawRectangle(p, colonRect1);
g.DrawRectangle(p, colonRect2);
break;
}
}
The errror says: "Generic GDI+ error."
Have anybody experienced anything like that and if yes how to I fix it.
This is the second control that I am using in my app - the first one is located on a different form. (I did eliminated the work 'static' from the Graphics variable but it did not help, I'd really like to solve this since it is a showstopper for using this clock.
|
|
|
|
 |
|
 |
Same issue with GDI+ error, the control work normally inside the showdialog form.
|
|
|
|
 |
|
 |
The author probably doesn't care any more, but maybe some else is able to extend this a little.
I'd like to add some more colors for the digits, like yellow, cyan, purple, orange, hotpink.
Im having a very hard time reading and understanding the code behind this, as im a VB.Net hobby programmer and C# is not my preferable language.
Basically, you need to add those colors to the DigitalColor enum. I can do that, but i have no idea what else to modify. I found these:
static private void setDimPen()
{
if (dimPen == null) dimPen = (Pen)pen.Clone();
dimPen.Width = pen.Width;
dimPen.Color = Color.FromArgb(
pen.Color.R > 0 ? 60 : 0,
pen.Color.G > 0 ? 60 : 0,
pen.Color.B > 0 ? 60 : 0);
}
static internal void SetPenColor(DigitalColor dclr)
{
pen.Color = Color.FromArgb(
(dclr == DigitalColor.RedColor) ? 255 ,
(dclr == DigitalColor.GreenColor) ? 255 ,
(dclr == DigitalColor.BlueColor) ? 255 );
setDimPen();
}
Im guessing i need to modify those, but im not sure how, it doesn't make sense to me. 255 for example, should'nt that be 255 because that's the RGB value for red.
Who's willing to help me and extend this awesome clock control with some more colors for the digits?
EDIT Jan 12 2011:
I was right, he doesn't care. Nobody does.
http://www.themightyatom.nl
modified on Tuesday, January 11, 2011 7:34 PM
|
|
|
|
 |
|
 |
I am going to show time of 5 contries in one page. I drag and drop 5 controld and gave the all properties for each like colot; hour format, datetime but when i run code it shows one clock running all the time others r freezed. i have not freeze value even.
If you plase tell me where should i check it would be greatful.
Thankz ur corperation is appriciated!
|
|
|
|
 |
|
 |
// for each digit the display bits are set into an int
// 'A' and 'P' are included for AM and PM display in the clock
private int[] displayNum = new int[12]{63,12,118,94,77,91,123,14,127,95,
111, // to display 'A'
103};// to display 'P'
111 its not an ascii code for A
can you Send the didplay bits for M char?
can you explian from where you got these numbers for the display bits?
|
|
|
|
 |
|
|
 |
|
 |
There is not digitalClockCtrl.RaiseAlarm function in the code? onRaiseAlarm() is the action where timing is come right? what happen to the source code cant open, msg: Make sure the application for the project type (.csproj) is installed! and i can't find any .vb file too
|
|
|
|
 |
|
 |
Has anyone able to convert this project source to VB 2005 yet?
Direct upgrade of the source code through Visual Studio is not a big help. The characters drawn end crammed far up in the left corner of the control. Something maybe wrong with the drawing/graphics class DigitalDisplay.vb.
Author, Please update code to VB2005 and update article.
Thanks
Peace!
|
|
|
|
 |
|
 |
I'm going to try to implement this tomorrow in my .net web application, but I was wondering if it's possible to set the start time on the stop watch. For example, I need to display an elapsed time when a user loads a page and continue the timer from there. So when the user opens the app, the stopwatch will display 12:05:30 and continue counting up until stopped.
If this is possible, it will be a lifesaver and the only solution I've found for this purpose. Thank you in advance for your help and for this very useful code.
Also, will this work with 2.0?
And one more thing. Is it possible to read the current (frozen) time? This is not a complete necessity as I can figure out the elapsed time based on when it was started and frozen, but for the sake of accuracy, it'd be nice.
|
|
|
|
 |
|
 |
Hi Sriram,
Your stuff is really helpful! Since this is "Free Source Code" will it be possible to use code you posted here for own projects (private ones as well as comercially ones)?
Thanks,
Rene
|
|
|
|
 |
|
 |
Rene
please feel free to use the code.
If you can acknowledge the article and provide a link to the article in your code files it will be great.
Good luck.
regards,
sriram
Sriram Chitturi
|
|
|
|
 |
|
|
 |
|
 |
Hello,
Could you tell me if there is a way to access the Hours, mins, seconds values when the clock is set to freese mode, as I would like to be able to store these in a database.
Thanks.
Mark Gales
|
|
|
|
 |
|
 |
Hi, i wonder if you can help me. I'm still pretty much a novice where programming is concerned and my latest project using VB.net has had me chasing my tail.
I'm trying to make a countdown timer for an event in the future, ie you select a date for an appointment and i want to be able to count down in years, months, days, hours, minutes and seconds. I've been playing with time.interval, but only have managed minor success. I see that there is a compare 'class', but i don't understand the syntax to use it. All i want to do is compare two dates and countdown from one to the other.
Can you help?
Brian Hull
|
|
|
|
 |
|
|
 |
|
 |
Is there an aspx version of this - so I can just get the time on the web?
And how do I install the code in Visual Studio .NET?
Walkthrough for the naive?
Thanks,
Tmuld.
Help
|
|
|
|
 |
|
 |
If you want to open the source code in Visual Studio, download the source code and open the solution (sln) or project (proj) file in Visual Studio.
For adding the control in the Visual Studio please see the Using the Control section in the article.
regards
Sriram Chitturi
|
|
|
|
 |
|
 |
Hi, I'm relatively new to Visual Studio and C#.. i downloaded the source code for this project as it is precisely what I require for my project, however, once I compile the dll and try to import it into the Toolbox, it fails. When it is listed in the "Add to" dialog box, it's greyed out, and when I click Okay it doesn't appear in the Toolbox, even though it was ticked.
According to the upgrade log, there was no problem upgrading from VS 2003 to VS 2005, and the Build completed with no errors. I even built the test program and that worked fine... so, what am I doing wrongly?
Thanks,
Stabarinde
|
|
|
|
 |
|
 |
Hello,
The clock is great. (I'm using it on .Net 2005)
But when i try to display 2 clocks on the same form it doesn't work. any idea why?! (to "work around" this problem i created another dll and now i have 2 refrences with different names)
Regards, Lin.
|
|
|
|
 |
|
 |
It's almost certainly the "static" Graphics member. Just remove the static keyword, and it should work fine.
(BTW, why is it static?)
|
|
|
|
 |
|
|
 |
|
 |
Hi there. I'm not sure if its something I'm doing incorrectly but the clock doesn't seem to work correctly on my web project. If I create and add it to a windows application it works correctly, but as soon as I try to add it to a project that is located on a server, not on my machine, the control becomes disabled. Is there any way that I can get around this?
Jackie
|
|
|
|
 |