home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_BAS
/
DGDEMO.ZIP
/
TGDEMO8.FRM
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1994-01-25
|
5KB
|
105 lines
Demo8
Demo 8 - DropDown Editing
Form15`
Table2
TgDemo
MS Sans Serif
UserCode
FirstName+" "+LastName+", "+Company
Data2R
Data2%
OE.MDB
Customers
Data2
Data1%
OE.MDB
Contacts
Data1
Table1
TgDemo
MS Sans Serif
UserCode
ContactDate
Call?
Callback
Yes/No
Comments
Comments
Data1R
Text1
MS Sans Serif
@ Form_Load
Text1
Form_Unload
Canceld
QuitCurrentDemo
Table1_Append=
Data1
Recordset
Table1_LeftColChange
Table2
Visible
Table1_RequestEdit
KeyAscii
Table1
ColumnName
ColumnIndex
Leftz
CellRectLeft
CellRectTop
CellRectHeight
Data2
NoMatch
ColumnText
Table1_RowChange
EditMode
Caption
RowIndex
Table1_TopRowChange
Table2_DblClick
Table2_LostFocus
Form_Load
Put the legend text in the form's text boxx
Illustrates:
- DropDown Editing (click on current cell in Code column)
- One key editing (type Y or N in Call? column)
- Automatic AddNew (press down arrow at last record)
- Memo field editing (click on current cel in Comments column)
Form_Unload
Table1_Append
AddNew triggers TrueGrid to "open up" a new
row for adding records.
Table1_LeftColChange
When the grid scrolls, we make sure the pop-upr
is gone.
Table1_RequestEdit
RequestEdit is called each time you click on the
current cell. You can decide what happens andh
whether standard editing proceeds. This allows
you to substitute different kinds of editing for
the current cell, as is done here.o
The Code column will display a popup (hidden
elsewhere as Table2) to allow selection.d
exit if they tried to overtypen
cancel built-in editing
Position the pop-up relative to the current cell
and find the item which matches the one currently
displayed in the main grid cell.t
UserCode =
Call?
The Call column can be edited just by typinge
"Y" or "N", so we don't use the standardp
built-in editor.e
Table1_RowChange
Change the data control caption to indicate whether
we are adding or browsing an existing row.e
Adding new record...
Record #
Table1_TopRowChange
Hide the popup if we scroll.
Table2_DblClick
When an item is selected in the pop-up, copy its value
to the proper column in the main grid.,
Table2_LostFocus
Hide the popup if it loses focus.