Recent

Author Topic: TCheckBox draw like as TRadioButton  (Read 3954 times)

papelhigienico

  • New Member
  • *
  • Posts: 18
    • PascalSCADA
TCheckBox draw like as TRadioButton
« on: August 06, 2007, 09:38:23 pm »
I'm creating a component descendent from TCheckBox, but I want paint it like a TRadioButton. How to do this?

antonio

  • Hero Member
  • *****
  • Posts: 605
RE: TCheckBox draw like as TRadioButton
« Reply #1 on: August 06, 2007, 09:49:36 pm »
Why don't you simply use a TRadioButton? What are you trying to do?

papelhigienico

  • New Member
  • *
  • Posts: 18
    • PascalSCADA
RE: TCheckBox draw like as TRadioButton
« Reply #2 on: August 06, 2007, 10:32:16 pm »
sorry, I don't explain right...

My Hierarchy:

TCheckBox -> THMICheckBox -> THMIRadioButton;

Because of a lot of procedures, functions and propertys that are implemented in THMICheckBox, to me is more easy redraw the component like as RadioButton. In Delphi I can do this, but in Lazarus I don't found any way to do this. It's possible?

antonio

  • Hero Member
  • *****
  • Posts: 605
RE: TCheckBox draw like as TRadioButton
« Reply #3 on: August 06, 2007, 11:30:19 pm »
Probably yes. Probably you must write your Paint procedure to paint it as a RadioButton.

papelhigienico

  • New Member
  • *
  • Posts: 18
    • PascalSCADA
RE: TCheckBox draw like as TRadioButton
« Reply #4 on: August 07, 2007, 01:39:06 pm »
I found an way to do this. At end of unit of your component, add initialization section and add this code

  RegisterWSComponent(ClassOFYourComponent, FindWSComponentClass(ClassThatYouLike));

 

TinyPortal © 2005-2018