Here is a better sample:
// Create the dialog to get type of workorder, search type , browse list
DEFINE DIALOG oDpw0 BRUSH oBrush TRANSPARENT RESOURCE "PRO100r" OF oWdlg FONT oMFont
// Create radio controls
REDEFINE RADIO aRadio[1] VAR aRadOpts[1] ID 417, 418, 419 OF oDpw0 ON CLICK oLbwlu:setfocus( )
REDEFINE RADIO aRadio[2] VAR aRadOpts[2] ID 427, 429, 430 OF oDpw0 ;
ON CLICK ( IIF( aRadOpts[2] = 3, oUnt:setOrder("evecom") , oUnt:setOrder("evelic") ), oUnt:gotop(), oLbwlu:setfocus( ) )
// Create button control
REDEFINE BTNBMP RESOURCE "HROK" ID 416 OF oDpw0 TOOLTIP "Create workorder" PROMPT "Accept" ;
ACTION oDpw0:end() NOBORDER TRANSPARENT
REDEFINE BTNBMP RESOURCE "APPT" ID 415 OF oDpw0 TOOLTIP "Create from an appointment" PROMPT "Appointment" ;
ACTION ( aAppt := ShowAppts( aAppt ), lByAppt := .T. , oDpw0:end() ) NOBORDER TRANSPARENT
// Create the browse
REDEFINE XBROWSE oLbwlu ID 440 OF oDpw0
// Attach the database
oLbwlu:setoDBF( oUnt )
// Add the columns
add to oLbwlu Header "Client" data oUnt:clicom ALIGN LEFT
add to oLbwlu header sLbl[4] data oUnt:VehLic ALIGN LEFT
add to oLbwlu Header "Year" data oUnt:VehYer ALIGN LEFT
add to oLbwlu Header "Make" data oUnt:VehMak ALIGN LEFT
add to oLbwlu Header "Model" data oUnt:VehMod ALIGN LEFT
// Provide the header gradient
oLbwlu:bClrGrad := { | lInvert | If( ! lInvert, { { 0.50,16776960,16777215 }, ;
{ 0.50,16777215,16776960 } }, { { 0.50,128,16777215 }, { 0.50,16777215,128 } } ) }
// Set the header and row heights
oLbwlu:nHeaderHeight := 30
oLbwlu:nRowHeight := 24
oLbwlu:nStretchCol := STRETCHCOL_WIDEST
// Turn off horizontal scrolling
oLbwlu:lHScroll := .F.
// Set the styles
oLbwlu:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbwlu:nColDividerStyle := LINESTYLE_RAISED
oLbwlu:nRowDividerStyle := LINESTYLE_RAISED
// Use for incremental search on opened database
oLbwlu:bSeek := { |c| oUnt:Seek( Upper( c )) }
FOR nCCol := 1 TO LEN( oLbwlu:acols )
oLbwlu:aCols[nCCol]:nHeadStrAlign := AL_CENTER
NEXT
// Activate dialog
ACTIVATE DIALOG oDpw0 ON PAINT oLbwlu:setfocus( ) ON INIT oDpw0:center(wndmain())
And here is the .RC
PRO100R DIALOG DISCARDABLE 0, 0, 650, 245
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_VISIBLE
CAPTION "Start Workorder"
FONT 8, "Arial"
BEGIN
CONTROL "", 440, "TXBROWSE", WS_TABSTOP|0x00a00000, 10, 40, 630, 130
CONTROL "Estimate", 417, "Button", BS_RADIOBUTTON, 10, 6, 60, 10
CONTROL "Invoice", 418, "Button", BS_RADIOBUTTON, 80, 6, 60, 10
CONTROL "Counter Sale", 419, "Button", BS_RADIOBUTTON, 150, 6, 60, 10
CONTROL "Cash Sale", 427, "Button", BS_RADIOBUTTON, 10, 20, 60, 10
CONTROL "Search by License", 429, "Button", BS_RADIOBUTTON, 150, 20, 100, 10
CONTROL "Search by Client", 430, "Button", BS_RADIOBUTTON, 260, 20, 100, 10
CONTROL "", 416, "Button", WS_TABSTOP, 195, 175, 60, 60
CONTROL "", 415, "Button", WS_TABSTOP, 245, 175, 60, 60
END
And the .dbf structure:
VEHLIC C 12 0 License
VEHYER C 4 0 Model year
VEHMAK C 25 0 Make
VEHMOD C 25 0 Model
CLICOM C 25 0 Client name
As I indicated, it has worked perfectly for years, up through ( and including ) 15.06.
Tim