Пример #1
0
        /// <summary>
        /// Handles when selection on the spreadsheet is changed
        /// </summary>
        private void HandleSelectionChanged(SpreadsheetPanel ss)
        {
            int    col, row;
            string name;

            ss.GetSelection(out col, out row);
            name       = (Convert.ToChar(col + 97)).ToString().ToUpper() + (row + 1);
            activeCell = name;
            RefreshTextBoxes();
        }
 /// <summary>
 /// Every time the selection changes, this method is called with the
 /// Spreadsheet as its parameter.  We display the current time in the cell.
 /// </summary>
 private void displaySelection(SpreadsheetPanel ss)
 {
     int row, col;
     String value;
     ss.GetSelection(out col, out row);
     ss.GetValue(col, row, out value);
     if (value == "") 
     {
         ss.SetValue(col, row, DateTime.Now.ToLocalTime().ToString("T"));
         ss.GetValue(col, row, out value);
         MessageBox.Show("Selection: column " + col + " row " + row + " value " + value);
     }
 }
Пример #3
0
        /// <summary>
        /// Every time the selection changes, this method is called with the
        /// Spreadsheet as its parameter.  We display the current time in the cell.
        /// </summary>
        private void displaySelection(SpreadsheetPanel ss)
        {
            int    row, col;
            String value;

            ss.GetSelection(out col, out row);
            ss.GetValue(col, row, out value);
            if (value == "")
            {
                ss.SetValue(col, row, DateTime.Now.ToLocalTime().ToString("T"));
                ss.GetValue(col, row, out value);
                MessageBox.Show("Selection: column " + col + " row " + row + " value " + value);
            }
        }