Dennis_Treacy
asked on
Setfocus in edit box of TFindDialog
When executing TFindDialog, how do I get the cursor is in the edit box without clicking in the edit box. I know FindText will put text in the box but I want the cursor there too.
I think Dennis_Treacy is talking about the EditBox in the TFindDialog...
I looked at the components[] property, but it counts 0...
TFindDialog calls the function from
function FindText; external commdlg32 name 'FindTextA';
As
FFindHandle := FFindReplaceFunc(FFindRepl ace);
So we have to look at the child windows of FFindHandle, But it's private :)..
An ugly approach:
Copy all the codes of TFindDialog to a new unit,
Then, by the help of FindWindowEx function acquire the handle of EditBox,
Finally call the function Windows.SetFocus(HandleOfE ditBox);
However, If i execute the FindDialog, The focus is on EditBox..
I looked at the components[] property, but it counts 0...
TFindDialog calls the function from
function FindText; external commdlg32 name 'FindTextA';
As
FFindHandle := FFindReplaceFunc(FFindRepl
So we have to look at the child windows of FFindHandle, But it's private :)..
An ugly approach:
Copy all the codes of TFindDialog to a new unit,
Then, by the help of FindWindowEx function acquire the handle of EditBox,
Finally call the function Windows.SetFocus(HandleOfE
However, If i execute the FindDialog, The focus is on EditBox..
Ugly approach became very ugly when i tried :)..
Have to copy half of the unit Dialogs...So let's forget it...
Have to copy half of the unit Dialogs...So let's forget it...
if you run like this the edit box in the find dialog will be focused
FindDialog1.Execute(Edit1. Handle);
FindDialog1.Execute(Edit1.
ASKER
Edit1 is an undeclared identifier. Is there an actual published name for that edit box component?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
FindDialog1.Execute(self.H andle) is the answer;
Edit1.Setfocus;