Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Thu, 24 Jul 2008 17:28:40 +0200,    group: microsoft.public.dotnet.framework.windowsforms.controls        back       


How to refresh an unbound listbox ?   
I've got a listbox. When I double click the listbox, I update the selected 
object and would like to udpate the displayed text for this object.

For now I've got :

' Update goes here
' ...

' Nom I refresh the text of the selected item from the underlying object
MyList.Text=MyUpdatedObject.ToString

' What should I do here so that the new text is shown in the listbox ?

I tried to call Invalidate, Refresh etc... but it still shows the initial 
text....

How can I update the text for one of the line shown using an unbound listbox 
(I added my own objects using MyList.Items.Add(MyObject))...

Thanks in advance...
date: Thu, 24 Jul 2008 17:28:40 +0200   author:   Patrice http://www.chez.com/scribe/

Re: How to refresh an unbound listbox ?   
Solved, what I found for now is :

MyList.Items(MyList.SelectedIndex)=MyUpdatedObject

Looks like reaffecting the updated object triggers the call to the ToString 
method and refreshes the list using this new text...

--
Patrice

"Patrice" <http://www.chez.com/scribe/> a écrit dans le message de groupe de 
discussion : 34146037-B63E-43E5-90AF-630963D33882@microsoft.com...
> I've got a listbox. When I double click the listbox, I update the selected 
> object and would like to udpate the displayed text for this object.
>
> For now I've got :
>
> ' Update goes here
> ' ...
>
> ' Nom I refresh the text of the selected item from the underlying object
> MyList.Text=MyUpdatedObject.ToString
>
> ' What should I do here so that the new text is shown in the listbox ?
>
> I tried to call Invalidate, Refresh etc... but it still shows the initial 
> text....
>
> How can I update the text for one of the line shown using an unbound 
> listbox (I added my own objects using MyList.Items.Add(MyObject))...
>
> Thanks in advance...
>
>
>
date: Thu, 24 Jul 2008 17:46:20 +0200   author:   Patrice http://www.chez.com/scribe/

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us