Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Box Class won't allow typing...
Message
From
01/09/2000 04:22:36
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Combo Box Class won't allow typing...
Miscellaneous
Thread ID:
00411624
Message ID:
00411624
Views:
55
Hi!

I made a combo box classs it works fine exept for 1 detail.
This is a drop down combo and I can type but as soon
as I resize the grid that contains it or when the valid event
fires....The values are gone.

I can only select items from the list and then it works.

The control source I set on the grid column I tried with and without a control source...

I can't figure out what is wrong can someone plese help me...

Here is the class...

*******************************************
DEFINE CLASS GeneralComboBox AS COMBOBOX

ctable=""
lrowsource=.F.
cCursor=""
cFld=""

PROCEDURE init

IF this.lrowsource
cName=alltrim(this.cFld)
IF NOT 'UNIT'$UPPER(cName)

this.rowsource="select "+cName+" from shppop where not empty("+cName+") order by "+cName+" into cursor cSHP"+cName
this.ccursor="cSHP"+cName
this.rowsourcetype=3
ELSE
this.rowsource="select distinct unitfrom from units where not empty(unitfrom) order by unitfrom into cursor cshpUnit"
this.ccursor="cshpUnit"
this.rowsourcetype=3
this.value="cm"
this.value="cm"
this.displayvalue="cm"
this.refresh()
ENDIF
ENDIF
this.fontsize=8

ENDPROC

PROCEDURE LOSTFOCUS

IF NOT EMPTY(THIS.cTable)
cTableFld=THIS.cTable+ "." +This.cFld
REPLACE &cTableFld WITH RTRIM(This.DisplayValue)
ENDIF
ENDPROC

PROCEDURE VALID
SET STEP ON
*!* IF NOT EMPTY(THIS.cTable)
*!* cTableFld=THIS.cTable+ "." +This.cFld
*!* REPLACE &cTableFld WITH RTRIM(This.DisplayValue)
*!* ENDIF
ENDPROC

PROCEDURE GOTFOCUS
LOCAL cField
cName=alltrim(this.cFld)

IF NOT 'UNIT'$UPPER(cName)
this.rowsource="select "+cName+" from shppop where not empty("+cName+") order by "+cName+" into cursor cSHP"+cName
this.ccursor="cSHP"+cName
this.rowsourcetype=3
ELSE
this.rowsource="select distinct unitfrom from units where not empty(unitfrom) order by unitfrom into cursor cshpUnit"
this.ccursor="cshpUnit"
this.rowsourcetype=3
this.value="cm"
this.displayvalue="cm"
this.refresh()
ENDIF

cField = THIS.cTable + "." + This.cFld
This.DisplayValue = RTRIM(&cField)
ENDPROC

PROCEDURE DESTROY
IF this.lrowsource
IF USED(THIS.cCursor)
USE IN (THIS.cCursor)
ENDIF
ENDIF

ENDPROC

PROCEDURE REFRESH
LOCAL cField
cField = THIS.cTable + "." + This.cFld
This.DisplayValue = RTRIM(&cField)
ENDPROC

PROCEDURE RIGHTCLICK
CopyPasteRowRightClick()
ENDPROC

ENDDEFINE
Next
Reply
Map
View

Click here to load this message in the networking platform