Saturday, October 11, 2008  



 FarPoint Technologies
 (800) 645-5913

 fpsales@fpoint.com



     
 »Spread »Product Tour » Customizing User Interaction

Previous Customizing User Interaction Next

Allow Users to Drag and Drop Cells | Allow Users To Sort Columns | Display Scroll Bars Only When Needed | Display Scroll Tips | Specify the Pointer | Display Text Tips | Provide Cell Notes | Customize the Enter Key Action | Turn Off the Clipboard Shortcut Keys | Specify When Buttons Appear

  Back to Top
 Allow Users to Drag and Drop Cells
   You can specify whether the user can select a cell or range of cells and drag and drop them to a new location in the same spreadsheet.

The following example allows the user to move or copy the contents of a cell or a block of cells using the drag-and-drop operation.

fpSpread1.AllowDragDrop = True


  Back to Top
 Allow Users To Sort Columns
   You can specify whether the user can sort columns in ascending or descending order when they click a column header. You can specify whether a sort indicator appears in the column header to show what type of sort has occurred. Sorting toggles between ascending and descending with each click.

The following example allows the user to automatically sort by clicking on the desired column header.

fpSpread1.UserColAction = UserColActionSort
For i = 1 To fpSpread1.MaxCols
  fpSpread1.Col = i
  fpSpread1.ColUserSortIndicator(i) = ColUserSortIndicatorAscending
Next i

 Back to Top
 Display Scroll Bars Only When Needed
   By default, the spreadsheet displays the scroll bars you specified for it to display at all times. Alternatively, the control can display scroll bars only when the size of the spreadsheet is larger than the size of the view.

The following example hides the scroll bars when the maximum number of rows or columns fit in the control boundaries.

fpSpread1.ScrollBarExtMode = True

  Back to Top
 Display Scroll Tips
   You can make scroll tips display when the user moves the horizontal or vertical scroll box or both. The scroll tip displays "Column: nn" on the horizontal scroll bar and "Row: nn" on the vertical scroll bar, where "nn" is the column or row designation.

The following example displays the scroll tips for the vertical column only.

fpSpread1.ShowScrollTips = ShowScrollTipsVertical

  Back to Top
 Specify the Pointer
   You can specify the pointer to display for different areas of the spreadsheet. You can choose one of four pointers (default pointer, arrow, column resize, or row resize). If you are using the ActiveX control, you can define a custom icon to display as the pointer.

The following example changes the cursor to an arrow when the mouse is over the column headers.

fpSpread1.CursorType = CursorTypeColHeader
fpSpread1.CursorStyle = CursorStyleArrow


  Back to Top
 Display Text Tips
   The fpSpread control provides text tips that can be displayed for any header or any cell in the control. Text tips are displayed in ToolTip windows for the header or cell that is under the pointer.

The following example initializes the text tip display. Custom text can be displayed using the TextTipFetch event.

fpSpread1.TextTip = TextTipFixed
fpSpread1.SetTextTipAppearance "MS Sans Serif", 14, 0, 0, &HC0FFFF, &H0&


  Back to Top
 Provide Cell Notes
   You can attach a note to a cell to contain text such as a comment, a question, or documentation describing the origin of the cell's value. A cell with a note attached displays a small red square (cell note indicator) in the upper right corner of the cell.

The following example attaches a note to cell B1.

fpSpread1.Row = 1
fpSpread1.Col = 2
fpSpread1.cellnote = "This is a cell note"


  Back to Top
 Customize the Enter Key Action
   You can control where the focus rectangle moves (up, down, left, right, next cell, previous cell, or first column of the next row) when the user presses the Enter key when edit mode is on. You can also specify that the focus rectangle stays at the same cell. .

The following example moves the active cell down when the user presses the Enter key.

fpSpread1.EditEnterAction = EditEnterActionDown
 

  Back to Top
 Turn Off the Clipboard Shortcut Keys
   Users can use Clipboard shortcut keys to cut (Ctrl+X or Shift+Del), copy (Ctrl+C or Ctrl+Ins), and paste (Ctrl+V or Shift+Ins) data in the spreadsheet. If you prefer, you can turn off these Clipboard shortcut keys.

The following example turns off the Clipboard shortcut keys.

fpSpread1.AutoClipboard = False
 

  Back to Top
 Specify When Buttons Appear
   When you use combo boxes, buttons, or spin buttons in cells, you can specify when the spin button (in date, integer, or time cells), button, or drop-down arrow (in combo box cells) displays: always, only in the current cell, only in the current column, only in the current row, always in button cells, or always in combo box cells.

You might want to hide buttons to keep your spreadsheet from looking cluttered. For example, if your spreadsheet has an entire column of combo box cells, you might want to display the drop-down button only in the current cell.

The following example displays buttons only in the current active row.

fpSpread1.ButtonDrawMode=
SS_BDM_CURRENT_ROW


Previous Customizing User Interaction Next

    
 Have a question?
Have a Question? Ask Us!
Subscribe to the RSS feed!RSS Subscribe
 

 
Learn about the new Roadshow now!


Developer Tour
Adding Data
Saving Data
Working with Data
Working with Spreadsheets
Printing Spreadsheets
Customizing Columns and Rows
Working with Cells
Working with Cell Types
Binding to Databases
Customizing the Spreadsheet Display
Customizing User Interaction
Spread Designer Overview
50 Spread Events
Rate Tour

Copyright © 1991-2007 FarPoint Technologies, Inc. All rights reserved. All names are property of their respective owners.