Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to pull the information from a memo
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00398437
Message ID:
00398585
Views:
16
Hi Barbara.

>> However, editboxes inside grids have only very limited display areas. <<

Which is why my base class editbox has a shortcut menu associated with it that allows the user to expand the edit box and change its font < s >. The code is generic and will expand the edit box property whether it's on a form, page, or in a grid.

The enlarge method looks like this:
WITH This
  .SaveOriginalDimensions()
  DO CASE
  CASE UPPER( .Parent.BaseClass ) = 'COLUMN'
    *** If this is the CurrentControl in a grid column, we must expand the current grid cell before
    *** expanding the edit box
    .ExpandGridCell()
    .Height = .Parent.Parent.RowHeight
    .Width  = .Parent.Width

  CASE UPPER( .Parent.BaseClass ) = 'PAGE'
    *** This is also a special case because pages do not have a height property. The pageframe
    *** has a PageHeight property, so we have to use that to expand the edit box
    .Top    = 0
    .Left   = 0
    .Height = .Parent.Parent.PageHeight
    .Width  = .Parent.Parent.PageWidth
    .zOrder(0)			&& Make sure the edit box appears on top of the other objects

  OTHERWISE	
    .Top    = 0
    .Left   = 0
    .Height = .Parent.Height
    .Width  = .Parent.Width
    .zOrder(0)			&& Make sure the edit box appears on top of the other objects
			
  ENDCASE
  .lMaximized = .T.
ENDWITH		
This is the code that expands the grid cell:
LOCAL lnCol
WITH This.Parent
  FOR lnCol = 1 TO .Parent.ColumnCount
    .Parent.Columns[lnCol].Width = 0
  ENDFOR	
  .Width		= .Parent.Width
  .Parent.RowHeight	= .Parent.Height - .Parent.HeaderHeight
  INKEY( .2 )
  *** Now scroll the grid to make the current row the one that is visible in the grid
  DO WHILE .Parent.RelativeRow # 1
    .Parent.DoScroll(1)
  ENDDO	
ENDWITH		
Marcia
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform