Thanks Fabio,
Having been a developer for over 25 years, it still amazes me how a whole days worth of troubleshooting can be solved by a single line of code!..
The Universal Thread always comes through!
Now any idea why putting a NODEFAULT in the Click method of combo1 solves the problem?
>>Hi All,
>>
>>Here's another contribution to the DisplayValue bugginess:
>>
>>Run the following code. When you select an item from the Top Combobox, the 2nd Combo Box gets the Focus and Displays it's items. The problem is that the Top Combo Box which has a Control Source to a numerical Form Property will only display properly if on the first List Item. Remove the Control Source propery Value on Combo1 and everything works fine...Anyone from Microsoft out there?
>>
>>
>>PUBLIC oform1
>>
>>oform1=NEWOBJECT("form1")
>>oform1.Show
>>RETURN
>>
>>
>> **************************************************
>>*-- Form: form1 (d:\rainbow\combobug.scx)
>>*-- ParentClass: form
>>*-- BaseClass: form
>>*-- Time Stamp: 01/31/06 09:20:07 PM
>>*
>>DEFINE CLASS form1 AS form
>>
>>
>> Height = 138
>> Width = 167
>> DoCreate = .T.
>> AutoCenter = .T.
>> Caption = "Form1"
>> nnumber = ( 0)
>> Name = "Form1"
>>
>>
>> ADD OBJECT combo1 AS combobox WITH ;
>> BoundColumn = 2, ;
>> ColumnCount = 2, ;
>> ColumnWidths = "80,0", ;
>> RowSourceType = 1, ;
>> RowSource = "One,1,Two,2,Three,3,Four,4", ;
>> ControlSource = "THISFORM.nNumber", ;
>> Height = 24, ;
>> ColumnLines = .F., ;
>> Left = 24, ;
>> Style = 2, ;
>> Top = 24, ;
>> Width = 100, ;
>> BoundTo = .T., ;
>> Name = "Combo1"
>>
>>
>> ADD OBJECT combo2 AS combobox WITH ;
>> ColumnCount = 1, ;
>> RowSourceType = 1, ;
>> RowSource = "Value1,Value2,Value3,Value4", ;
>> Height = 24, ;
>> Left = 24, ;
>> Style = 2, ;
>> Top = 72, ;
>> Width = 100, ;
>> Name = "Combo2"
>>
>>
>> PROCEDURE combo1.InteractiveChange
>> WITH THISFORM.Combo2
>> .SetFocus()
>> KEYBOARD '{F4}' PLAIN CLEAR
>> ENDWITH && WITH THISFORM.Combo2
>> ENDPROC
>>
>>
>>ENDDEFINE
>>*
>>*-- EndDefine: form1
>>**************************************************
>
>try this
>
>PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>
>**************************************************
>*-- Form: form1 (d:\rainbow\combobug.scx)
>*-- ParentClass: form
>*-- BaseClass: form
>*-- Time Stamp: 01/31/06 09:20:07 PM
>*
>DEFINE CLASS form1 AS form
>
>
>Height = 138
>Width = 167
>DoCreate = .T.
>AutoCenter = .T.
>Caption = "Form1"
>nnumber = ( 0)
>Name = "Form1"
>
>
>ADD OBJECT combo1 AS combobox WITH ;
>BoundColumn = 2, ;
>ColumnCount = 2, ;
>ColumnWidths = "80,0", ;
>RowSourceType = 1, ;
>RowSource = "One,1,Two,2,Three,3,Four,4", ;
>ControlSource = "THISFORM.nNumber", ;
>Height = 24, ;
>ColumnLines = .F., ;
>Left = 24, ;
>Style = 2, ;
>Top = 24, ;
>Width = 100, ;
>BoundTo = .T., ;
>Name = "Combo1"
>
>
>ADD OBJECT combo2 AS combobox WITH ;
>ColumnCount = 1, ;
>RowSourceType = 1, ;
>RowSource = "Value1,Value2,Value3,Value4", ;
>Height = 24, ;
>Left = 24, ;
>Style = 2, ;
>Top = 72, ;
>Width = 100, ;
>Name = "Combo2"
>
>
>PROCEDURE combo1.InteractiveChange
>WITH THISFORM.Combo2
>.SetFocus()
>KEYBOARD '{F4}' PLAIN CLEAR
>ENDWITH
>ENDPROC
>
>PROCEDURE combo1.Click
> NODEFAULT
>ENDPROC
>
>ENDDEFINE
>
>
>This is a repro without Combo2:
>
>PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>
>
>DEFINE CLASS form1 AS form
>
>AutoCenter = .T.
>nnumber = 0
>
>ADD OBJECT combo1 AS combobox WITH ;
> BoundColumn = 2;
>,BoundTo = .T. ;
>,ColumnCount = 2, ;
>ColumnWidths = "100,0", ;
>RowSourceType = 1, ;
>RowSource = "One,1,Two,2,Three,3,Four,4", ;
>ControlSource = "THISFORM.nNumber", ;
>Left = 24, ;
>Style = 2, ;
>Top = 24
>
>
> PROCEDURE combo1.click
>* uncomment NODEF and DisplayValue become stable
>* NODEFAULT
>
>
> PROCEDURE combo1.InteractiveChange
> thisform.themes = .T.
> CHRSAW(2)
> KEYBOARD '{F4}' PLAIN CLEAR
> ENDPROC
>
>ENDDEFINE
>