[Gambas-user] No text visible in textbox

ron ronstk at ...239...
Mon Apr 24 08:27:06 CEST 2006


On Wednesday 19 April 2006 07:08, ron wrote:
> 
> db records
> 1 "medium text"
> 2 "very long text to show nothing when short follows"
> 3 "short"
> 4 "medium text again"
> 
> The 4 buttons 'first' 'prev' 'next' and 'last'
> Textbox1 with size of record 4 characters
> txtPosit with the hResult.Index as position indicator
> 
> When 'first' followed by a serie of 'next' then if
> the record 3 should be shown the textbox1 looks empty.
> 
> After click in textbox1 when it looks empty the text occurs.
> If the focus (blinking cursor) stays in textbox1 and I click 
> on the navigation buttons the text stays visible in that box.
> I verify with second Textbox2 and the same content as textbox1
> 
>   IF hRecordData.Available THEN 
>     sKey = sFLDinProc
>     textbox1.Text = hRecordData[sKey]
>     textbox1.SetFocus
>     textbox2.Text = hRecordData[sKey]
>     textbox2.SetFocus
>     txtPosit.Text = hRecordData.Index + 1
>   ENDIF
> 
> Blinking cursor is during navigation in textbox2 and textbox1
> look still blank so .SetFocus did not help.
> 
> It occurs if a (very) long text is replaced by a short text by code.
> What is wrong?
> 
> Ron
> 

Kick :)

    textbox1.Text = CStr(hRecordData[sFLDinProc1])
    textbox1.Refresh 'solves problem short text after long text is hidden

    textbox2.Text = CStr(hRecordData[sFLDinProc2])
    textbox2.Refresh 'solves problem short text after long text is hidden

Bit stupid to use .Refresh on every control written to, to get correct view
if there is no focus on it.




More information about the User mailing list