Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling a Tlistview

Status
Not open for further replies.

pierrotsc

Programmer
Nov 25, 2007
358
0
0
US
I am disabling temporarily the onselectitem of a listview. I use
// disable Objects interaction
Mainform.ListViewObjects.OnSelectItem := nil;

Now how to i re enable it ?

Sincerely,
Pierre
 
the temp disable happens in a scope of a specific procedure, or for a longer time?
Anyway, you must reassign the eventhandler:

Code:
Mainform.ListViewObjects.OnSelectItem := <OriginalEventHandlerProcedure>;


-----------------------------------------------------
Helping people is my job...
 
Quick example. This is in a media player where the Trackbar must be moved to match the position of the song. The event handler has to be disabled because it would fire upon setting the position, causing a very undesirable situation in the program.
Code:
  TrackBar1.OnChange := nil;
  Trackbar1.Position := MediaPlayer1.Position;
  TrackBar1.OnChange := TrackBar1Change; //(name of the handler within the form)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top