Click here to Skip to main content
15,898,950 members
Home / Discussions / C#
   

C#

 
AnswerRe: How do i fix this mess!! Pin
Christian Graus28-Apr-08 18:09
protectorChristian Graus28-Apr-08 18:09 
GeneralRe: How do i fix this mess!! Pin
ketto28-Apr-08 18:30
ketto28-Apr-08 18:30 
GeneralRe: How do i fix this mess!! Pin
Christian Graus28-Apr-08 18:49
protectorChristian Graus28-Apr-08 18:49 
GeneralRe: How do i fix this mess!! Pin
ketto28-Apr-08 23:01
ketto28-Apr-08 23:01 
GeneralRe: How do i fix this mess!! Pin
Christian Graus28-Apr-08 23:58
protectorChristian Graus28-Apr-08 23:58 
GeneralRe: How do i fix this mess!! [modified] Pin
MarkB77728-Apr-08 18:56
MarkB77728-Apr-08 18:56 
GeneralRe: How do i fix this mess!! Pin
Christian Graus28-Apr-08 19:38
protectorChristian Graus28-Apr-08 19:38 
GeneralRe: How do i fix this mess!! Pin
MarkB77728-Apr-08 20:01
MarkB77728-Apr-08 20:01 
Just for you Christian Smile | :) .

<br />
using System;<br />
using System.Windows.Forms;<br />
using System.Drawing;<br />
<br />
namespace WindowsApplication1<br />
{<br />
    public partial class Form1 : Form<br />
    {<br />
        private Brush myBrush;<br />
<br />
        private const int barWidth = 40;<br />
<br />
        int seconds, minutes;<br />
<br />
        public Form1()<br />
        {<br />
            InitializeComponent();<br />
<br />
            this.myBrush = new SolidBrush(Color.Black);<br />
<br />
            this.timer1.Interval = 100;<br />
            this.timer1.Enabled = true;<br />
<br />
            this.seconds = 0;<br />
            this.minutes = 0;<br />
        }<br />
<br />
        protected override void OnPaint(PaintEventArgs e)<br />
        {<br />
            e.Graphics.FillRectangle(myBrush, 0, 0, (this.seconds*10), barWidth);<br />
            e.Graphics.FillRectangle(myBrush, 0, 60, (this.minutes * 10), barWidth);<br />
        <br />
            base.OnPaint(e);<br />
        }<br />
<br />
        private void button1_Click(object sender, EventArgs e)<br />
        {<br />
            this.timer1.Start();<br />
        }<br />
<br />
        private void button2_Click(object sender, EventArgs e)<br />
        {<br />
            this.timer1.Stop();<br />
        }<br />
<br />
        private void timer1_Tick_1(object sender, EventArgs e)<br />
        {<br />
            this.Invalidate();<br />
<br />
            if (this.seconds < 60)<br />
                this.seconds++;<br />
<br />
            else<br />
            {<br />
                this.seconds = 0;<br />
                this.minutes++;<br />
            }<br />
        }<br />
    }<br />
}<br />



GeneralRe: How do i fix this mess!! Pin
Christian Graus28-Apr-08 20:33
protectorChristian Graus28-Apr-08 20:33 
AnswerRe: How do i fix this mess!! Pin
Harvey Saayman28-Apr-08 21:16
Harvey Saayman28-Apr-08 21:16 
GeneralRe: How do i fix this mess!! Pin
ketto28-Apr-08 23:05
ketto28-Apr-08 23:05 
GeneralRandomly Removing an Item from an Array Pin
Ian Uy28-Apr-08 16:22
Ian Uy28-Apr-08 16:22 
GeneralRe: Randomly Removing an Item from an Array Pin
Paul Conrad28-Apr-08 16:24
professionalPaul Conrad28-Apr-08 16:24 
GeneralRe: Randomly Removing an Item from an Array Pin
Ian Uy28-Apr-08 20:15
Ian Uy28-Apr-08 20:15 
GeneralRe: Randomly Removing an Item from an Array Pin
PIEBALDconsult29-Apr-08 6:15
mvePIEBALDconsult29-Apr-08 6:15 
GeneralRe: Randomly Removing an Item from an Array Pin
Christian Graus28-Apr-08 18:12
protectorChristian Graus28-Apr-08 18:12 
QuestionProgramming to DataTables VS. Programming to type safe objects using generic interfaces? Pin
Steve Holdorf28-Apr-08 11:17
Steve Holdorf28-Apr-08 11:17 
GeneralRe: Programming to DataTables VS. Programming to type safe objects using generic interfaces? Pin
Pete O'Hanlon28-Apr-08 11:52
mvePete O'Hanlon28-Apr-08 11:52 
Generalcombining number and dateformating in one funcrtion Pin
stephan_00728-Apr-08 10:02
stephan_00728-Apr-08 10:02 
GeneralRe: combining number and dateformating in one funcrtion Pin
Gareth H28-Apr-08 10:35
Gareth H28-Apr-08 10:35 
GeneralRe: combining number and dateformating in one funcrtion Pin
PIEBALDconsult28-Apr-08 10:43
mvePIEBALDconsult28-Apr-08 10:43 
GeneralRe: combining number and dateformating in one funcrtion Pin
stephan_00728-Apr-08 10:54
stephan_00728-Apr-08 10:54 
GeneralRe: combining number and dateformating in one funcrtion Pin
PIEBALDconsult28-Apr-08 13:54
mvePIEBALDconsult28-Apr-08 13:54 
GeneralSystem.Timers.Timer Pin
geekfromindia28-Apr-08 9:11
geekfromindia28-Apr-08 9:11 
GeneralRe: System.Timers.Timer Pin
som.nitk28-Apr-08 9:14
som.nitk28-Apr-08 9:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.