Click here to Skip to main content
16,023,224 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi All;

I am creating a custom ListView control and have come across a question. There is no Loaded Event and i cant find a WindProc message for what i want either.

Does anyone know if there is a way of finding out when the control has either loaded or finished its last paint ect without using a form to find this out. Can the control work out if it has finished drawing itself?

Thanks George
Posted

1 solution

I've come accross this problem before, I think the simple answer is you have to use the form.

The simplest solution is to add an Initialised() function to each control and call this from the parent form.

Another way I tried once, that can get a bit messey, is to handle ParentChanged() event in your control. When the parent is set check if it is a Form, if it is subscribe to the FormLoaded event if it isn't check the control parent's parent and so one up to the root i.e. when Parent == null.
 
Share this answer
 
Comments
gwithey 14-Sep-10 8:47am    
This is what i thought, i was hoping there may be a way but these solutions will work so will give probably end up using the form method if that is possible using CAB.

Thanks for the Answer.

George

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900