Search Results

Search found 5 results on 1 pages for 'norlando02'.

Page 1/1 | 1 

  • Problem with first Windows 7 gadget getting javascript to run

    - by norlando02
    For my first windows gadget I'm trying to make one that displays the current time and date. The code below is what I have, but I can't figure out why the javascript is not running. Any ideas? <html> <head> http-equiv="Content-Type" content="text/html; charset=Unicode" /> <title>Clock</title> <style type="text/css"> body { width: 130px; height: 60px; margin: 1 1 1 2; } body { font-family: Segoe UI, Arial; font-size: 11px; font-weight: bold; white-space: nowrap; } </style> <script type="text/javascript"> var background; var interval; var connection_id; var timeZone; var now; function load() { try { interval = 1000; connection_id = 0; timeZone = System.Time.currentTimeZone; update(); } catch(e){} } function update() { try { now = new Date(Date.parse(System.Time.getLocalTime(timeZone))); curDate.innerHTML = now.format('M jS, Y'); curTime.innerHTML = now.format('h:i:s A'); clearTimeout(connection_id); connection_id = setTimeout("update()", interval); } catch(e) {} </script> </head> <body onload="load()"> <div id="curDate"> </div> <div id="curTime"> </div> </body> </html>

    Read the article

  • How do I auto size columns through the Excel interop objects?

    - by norlando02
    Below is the code I'm using to load the data into an Excel worksheet, but I'm look to auto size the column after the data is loaded. Does anyone know the best way to auto size the columns? using Microsoft.Office.Interop; public class ExportReport { public void Export() { Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application(); Excel.Workbook wb; Excel.Worksheet ws; Excel.Range aRange; object m = Type.Missing; string[,] data; string errorMessage = string.Empty; try { if (excelApp == null) throw new Exception("EXCEL could not be started."); // Create the workbook and worksheet. wb = excelApp.Workbooks.Add(Office.Excel.XlWBATemplate.xlWBATWorksheet); ws = (Office.Excel.Worksheet)wb.Worksheets[1]; if (ws == null) throw new Exception("Could not create worksheet."); // Set the range to fill. aRange = ws.get_Range("A1", "E100"); if (aRange == null) throw new Exception("Could not get a range."); // Load the column headers. data = new string[100, 5]; data[0, 0] = "Column 1"; data[0, 1] = "Column 2"; data[0, 2] = "Column 3"; data[0, 3] = "Column 4"; data[0, 4] = "Column 5"; // Load the data. for (int row = 1; row < 100; row++) { for (int col = 0; col < 5; col++) { data[row, col] = "STUFF"; } } // Save all data to the worksheet. aRange.set_Value(m, data); // Atuo size columns // TODO: Add Code to auto size columns. // Save the file. wb.SaveAs("C:\Test.xls", Office.Excel.XlFileFormat.xlExcel8, m, m, m, m, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange, m, m, m, m, m); // Close the file. wb.Close(false, false, m); } catch (Exception) { } finally { // Close the connection. cmd.Close(); // Close Excel. excelApp.Quit(); } } }

    Read the article

  • Check SuspendLayout

    - by norlando02
    Is there a way in C# to check if an object is suspend? I have a TreeView that I need to know if it is still suspend. myTreeView.BeginUpdate(); myTreeView.SuspendLayout(); // Do Stuff. myTreeView.EndUpdate(); myTreeView.ResumeLayout(); Because i have this code in a recursive function I want to know if the TreeView is already been suspended.

    Read the article

  • How do I get the current time in a Windows 7 gadget?

    - by norlando02
    For my first windows gadget I'm trying to make one that displays the current time and date. The code below is what I have, but I can't figure out why the javascript is not running. Any ideas? <html> <head> http-equiv="Content-Type" content="text/html; charset=Unicode" /> <title>Clock</title> <style type="text/css"> body { width: 130px; height: 60px; margin: 1 1 1 2; } body { font-family: Segoe UI, Arial; font-size: 11px; font-weight: bold; white-space: nowrap; } </style> <script type="text/javascript"> var background; var interval; var connection_id; var timeZone; var now; function load() { try { interval = 1000; connection_id = 0; timeZone = System.Time.currentTimeZone; update(); } catch(e){} } function update() { try { now = new Date(Date.parse(System.Time.getLocalTime(timeZone))); curDate.innerHTML = now.format('M jS, Y'); curTime.innerHTML = now.format('h:i:s A'); clearTimeout(connection_id); connection_id = setTimeout("update()", interval); } catch(e) {} </script> </head> <body onload="load()"> <div id="curDate"> </div> <div id="curTime"> </div> </body> </html>

    Read the article

1