Bizarre TListView/TTreeView behaviour when changing form's border icons
Quote
In article <3decd27...@newsgroups.borland.com>, Jason Wilson wrote:
> I am attempting to add an administrable option to an application which would
> disable the "minimize" and "restore" buttons in the title bar of a form. Of
> course, this may be achieved by disabling the border icons -- or I may even
> remove the border altogether (BorderStyle=bsNone). The intention is to
> preclude users from hiding or otherwise fiddling with the touch screen based
> application.
> Now the problem:
> There are several populated TListView and TTreeView components on the same
> form. Unfortunately, whenever I programatically alter either the BorderIcons
> property or the BorderStyle property I immediately get bombarded with
> "access violations" and "list index out of bounds" errors. Any thoughts as
> to how modifying the form's borders causes all hell to break loose in the
> tree/list views?
Modifying the border icons recreates the forms window handle, and with it the
window handles of all controls on the form. For a tree- or listview this also
means that all nodes or items are destroyed and recreated. This is usually no
problem, unless you use the OnDeletion event to free some objects you have stored
into the node.data property (same for listitem.data). The event is fired when the
nodes/items are destroyed during a RecreateWnd...
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be