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

PageControl problem

Status
Not open for further replies.

SLider3

Programmer
Jun 17, 2003
56
PT
Hello!

I put a TEdit called "show_text" into the form (Form1). In Unit1.cpp (the principal code file) i call a function called "Show" that is in other code file("other.cpp") and i put the prototipe of "Show" in Unit1.h (uni1.cpp header file). The funtion is this:

void Show()
{
Form1 -> show_text -> Text = "the text i want";
}

and it works just fine.

Then i add a PageControl into the form and i put the same TEdit in the PageControl and the function with the code line that i put above still works. But today i compiled the program and now it doesn´t work any more. I get an error, somethig like this: 'show_text' is not a member of 'TForm1'.

Why it doesn't work any more? Can someone help me please?
 
Now when you add a PageControl into the form and add the same TEdit in the PageControl, the thing changes.

you should write as below:

void Show()
{
Form1->PageControl->show_text -> Text = "the text i want";
}

because show_text's parent changes to PageControl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top