I have a combobox class I use for look-up tables. It has a .cTableName property and code in the requery event to populate a .aList property to hold to poulate the combo list. It works great except I can't control the ColumnWidths, they seem to have a mind of their own. Changing the property does seem to do anything.
I think it's locking the ColumnWidth to the width of the what's built by the SQL-select. Is there any way to control it?
Here is the Requery code:
LOCAL cSQLstr, cName
WITH THIS
IF EMPTY(.cTableName)
RETURN .F.
ENDIF
cSQLstr = "SELECT cDesc, pk_id " + ;
"FROM " + ALLTRIM(.cTableName) + " " + ;
"ORDER BY cDesc"
cName = .cTableName + "_" + SYS(UNIQUE_NAME)
THISFORM.oCon.SQLSelect(cSQLstr, cName)
IF RECCOUNT() > 0
DIMENSION .alist[ RECCOUNT(), 2 ]
COPY TO ARRAY .alist
ELSE
DIMENSION .alist[ 1, 2 ]
.alist = ''
ENDIF
USE IN (cName)
ENDWITH
Roi
'MCP' Visual FoxPro
In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!