Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Timer display

Timer display

Scheduled Pinned Locked Moved C#
helpcsharpjavascripttutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    ybasha
    wrote on last edited by
    #1

    Hi there am using a javascript to display a timer while running the process but earlier was using input value but now i need it to start while on button click i have the javascript but i need to know how to make it run in c#, pls find the code snippet below. function convertClickHandle(){if(Form1.<b>button1</b>.<b>click</b>='30') {clock(); return true; }else{ lblMessage.innerText = 'ERROR';return false;}}"); i need to know how to start the timer in the button click in form1.i need help on function to start timer on button click event pls do the need ful. <!-- var startTime = null; function clock() { //for showing a clock while processing if (!document.layers && !document.all) return; if(startTime == null) startTime = new Date(); var newTime = new Date(); var diff = newTime.getTime() - startTime.getTime(); var hours = Math.floor(diff/(1000*60*60)); var diff = diff - (1000*60*60*hours); var minutes = Math.floor(diff/(1000*60)); var diff = diff - (1000*60*minutes); var seconds = Math.floor(diff/1000); if (minutes <= 9) minutes = "0" + minutes; if (seconds <= 9) seconds = "0" + seconds; dispTime = "<br/><h3>Please wait while the file is being processed<h3><br/><h1>" + hours + ":" + minutes + ":" + seconds + "</h1>"; textBox.style.visibility = "hidden"; timeTicker.style.visibility = "visible"; if (document.layers) { document.layers.write.timeTicker(dispTime); document.layers.timeTicker.close(); } else if (document.all) timeTicker.innerHTML = dispTime; setTimeout("clock()", 1000); } --> Regards ybasha

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups