Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Creating components in run time III

Avatar of hidrau
hidrauFlag for Brazil asked on
Delphi
2 Comments1 Solution261 ViewsLast Modified:
Hello,

I am having a problem, I am making a test and in my test I need the hint of each edit hold a value,
when I check if the value typed is like in the hint, my hint is empty. Why? And I could notice that all my edits
are with the same value hint.

Please take a look in my code

procedure TForm1.Button2Click(Sender: TObject);
Var
  I, A : Integer;
  Ed: TwwdbEdit;
begin
  A := 10;
  For I := 0 to 10 do
  Begin
    Ed := TwwdbEdit.Create(self);
    Ed.Parent := Form1;
    Ed.Top    := A;
    Ed.Left   := 200;
    Hint      := 'A'  + IntTOStr(I);;
    ShowHint  := True;
    Name      := 'Ed' + IntTOStr(I);
    Inc(A,30)
  End;
end;


procedure TForm1.Button3Click(Sender: TObject);
Var
  I : Integer;
  A, B : String;
begin
  For I := 0 to Pred(ComponentCount) do
  Begin
    If (Components[I] is TwwDBEdit) Then
       if (Components[I] as Twwdbedit).Parent = form1 then
           Begin
             A := AnsiUpperCase(trim((Components[I] as Twwdbedit).Text));
             B := AnsiUpperCase(trim((Components[I] as Twwdbedit).hint));
             If A  <> B  Then
                Begin
                  (Components[I] as Twwdbedit).Font.Color := clRed;
                  (Components[I] as Twwdbedit).ShowHint   := True
                End
           end;
  End;
end;
ASKER CERTIFIED SOLUTION
Avatar of 2266180
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers