Board index » delphi » Bizarre TListView/TTreeView behaviour when changing form's border icons

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

 

Re:Bizarre TListView/TTreeView behaviour when changing form's border icons


Looks like I'll have to make the "no borders/border icons" option a command
line option and implement it before instantiating (or populating) the
List/Tree views.

Thanks again for your help...

Jason Wilson

"Peter Below (TeamB)" <100113.1...@compuXXserve.com> wrote in message
news:VA.000096ce.0064b6a8@antispam.compuserve.com...

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

Other Threads