OnPaint Is not being called

  • Thread starter Thread starter forkunal
  • Start date Start date
F

forkunal

I have made a class(Pin), derived from UserControl which implements its
own interface. To do so its OnPaint must obviously be called. This
Control is a part of another control(Gate) which acts as a container
for Pin. The problem is that the function Pin.OnPaint() is never
called. I had a similiar problem with Gate.OnPaint() earlier and found
that Gate.Height was acidentally being set to 0. Are there any minimum
requirements for a control to be drawn?(Any good refrence or
documentation link) Please help me out here. If you wanna take a look
at the code just mail me (e-mail address removed) . Thanks in advance.
 
Luckily found out the error. I forgot to add the new new control as a
part of the Main form as in MainForm.Contorls.Add(this) or something
similiar. Replied just in case someone overlooks the same stuff. I was
also not able to find this in the documentation. If there a good source
for the reqirements please point out the link.
 
Back
Top