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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Control

Status
Not open for further replies.

tlhawkins

Programmer
Dec 28, 2000
797
US
I think I've read everything on the net about creating custom controls but there is one thing I cannot find an answer to.

I am creating a custom edit control, not too complicated. I just want the default value of the control to be loaded from an INI file.

I can load from the ini file just fine. I can create the custom control just fine. But I can't seem to access the .Text property of the custom control from within the control. (does that make sense)

I read over the FAQ about custom controls, it creates a custom control to count the number of times a button was clicked. If someone could show me how to make the button Caption change to reflect the number of clicks I think I could use that to accomplish my goal.

Thanks for the help!

Travis Hawkins
 
Does your custom control have a Text property?

If you are using the TNewButton class then the way to get the button caption to display the number of clicks is to add the line
Code:
  Self.Caption := IntToStr(fSingleClickCount);
to the OnClick event handler.


Andrew
Hampshire, UK
 
If you were to show us the code you have, or relevant sections, I'm sure we'd be able to help you more effectively.

Clive [infinity]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top