Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox.requery/refresh?
Message
From
08/05/2001 06:50:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
08/05/2001 00:37:39
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00504559
Message ID:
00504609
Views:
18
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>I have made a listbox with two columns,I set the rowsource as an array A_text[num,2].
>
>A_text[num,1] is used as the entry ID, A_text[num,2] is to store the data..
>
>Since my program is needed to support multi_language.. sometimes I have to change the data of the array in this way:
>
>for i=1 to Num_of_entry
> A_text[i, 2] = Data_In_Different_Language
>endfor
>
>after the for-loop I run FormName.ListBoxName.requery() and FormName.ListBoxName.refresh() but the display doesn't changed correctly, only part of the text is changed, I have to run other function of the listbox (such as inserting/deleting some items in it) then the display will be correct again. Those function also have .requery() executed in it..
>
>Any suggestion please?

Jimi,
Probably NumberOfElements is wrong. ie: This works sucessfully :
-Create a form and add a listbox and a commandbutton to it
-Create a form property as myArray[1]
*Form.Load
with this
  dimension .myArray[10,2]
  for ix=1 to alen(.myArray,1)
    .myArray[ix,1] = 'ID'+padl(ix,5,'0')
    .myArray[ix,2] = 'Text'+padl(ix,5,'0')
  endfor
endwith

* Listbox.init
With this
  .ColumnCount =ALEN(thisform.myArray,2)
  .Columnwidths = '100,100'
  .NumberOfElements=ALEN(thisform.myArray)
  .RowSourceType=5
  .RowSource='thisform.myArray'
Endwith

*Commandbutton.click
with thisform
  for ix=1 to alen(.myArray,1)
    .myArray[ix,2] = 'Change'+padl(ix,5,'0')
  endfor
  .List1.Requery()
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform