Dynamic pagecontrol tab item control

Please discuss general Delphi programming topics here.

Dynamic pagecontrol tab item control

Postby Xslammer » August 23rd, 2010, 9:40 am

Hi all.

I have a pageControl on my page in which im adding its tabs dynamically.When adding the page control tabs i also add textboes and memos to it. so my problem now is how to add some text to a specific tab textbox, since everything within the tab has been added dynamic , i know how to find the tab on which i wanna alter changes to but i dont know how to make the changes to a textbox withing a specific tab dynamic. since wat i do is check the tab titles in my page to know the tab index of the tab which i wanna change its textbox text or memo text from the i dont know how to change d text in the textbox of that tab. Well i dont knw if i explained well but i hope someone gets wat im trying to accomplish.
Xslammer
Member
Member
 
Posts: 2
Joined: August 20th, 2010, 8:39 am

Re: Dynamic pagecontrol tab item control

Postby SaeedShekari » August 25th, 2010, 10:48 am

I have no idea what you are doing, but check these ways, hope these can help.

1) Simply behave the Editbox as usual :
If the component is a TEditBox > MyEditBox.Text:= ‘Hi all’;
Or if it is a TMemo > With MyMemo.Lines do Begin ………… End;

2) Or try below function (you have to edit it to suit your inquiries)
Code: Select all
Procedure ChangeMyComponent(Cont: TWinControl);
Var
  i: Integer;
begin
  For i:= 0 To Cont.ControlCount - 1 Do
  Begin
    If (Cont.Controls[i] Is TGroupBox) And (TGroupBox(Cont.Controls[i]).ControlCount > 0) Then
      SetControlsEn_Disabled(TWinControl(Cont.Controls[i]))
    Else
    Begin
      If Cont.Controls[i] Is TTextEdit Then
      With TTextEdit(Cont.Controls[i]) Do
      Begin
        //Do what you want
      End;
    End;
  End;
End;
//To Call tis function
// ChangeMyComponent(MyTabPage);

Saeed Shekari
User avatar
SaeedShekari
Active Member
Active Member
 
Posts: 20
Joined: March 8th, 2008, 2:01 pm
Location: UAE


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron