Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 02-21-2014, 08:35 PM
delphimpd delphimpd is offline
Senior Member
 
Join Date: Oct 2006
Posts: 701
Default Dynamically clicking on a found node

Hi and thanks in advanced for your help.

I have this function and procedure that finds a node based on a text, however after is found I need to simulate a mouse left clicking on the found item. Can anyone help me out on how to accomplish this is code

Here is the link of the example

http://delphi.about.com/od/vclusing/l/aa010703a.htm

Now, once is found I need to click on this found item.

Thanks
Reply With Quote
  #2  
Old 02-21-2014, 08:53 PM
delphimpd delphimpd is offline
Senior Member
 
Join Date: Oct 2006
Posts: 701
Default

Please disregard I got the fix based on this post

http://stackoverflow.com/questions/1...r-intervention
Reply With Quote
  #3  
Old 02-21-2014, 11:26 PM
major major is offline
Senior Member
 
Join Date: Jun 2011
Posts: 150
Default

I see you marked that you got the answer, but I'm not sure it's applicable to the question you asked. You asked to simulate a left click on the Node that is found. Not sure why you need to. If it's solely to have that node selected, then the code you linked to in your first post already does that...

Code:
procedure TForm1.Button1Click(Sender: TObject);
var
  tn : TTreeNode;
begin
   tn:=GetNodeByText(TreeView1,Edit1.Text,CheckBox1.Checked);
     ///**call the function that returns a TTreeNode ***///
   if tn = nil then  ///***if the TTreeNode is nil - No node found ***///
    ShowMessage('Not found!')
   else
    begin ///*** Node was found if you get here  ***///
      TreeView1.SetFocus;
      tn.Selected := True;
      ///***as long as the function actually found a node ***///
     ///*** set it as the selected node - this makes the   ***///
     ///** simulated left click irrelevant  ***///
    end;
end;
Reply With Quote
  #4  
Old 02-24-2014, 05:27 PM
delphimpd delphimpd is offline
Senior Member
 
Join Date: Oct 2006
Posts: 701
Default

Hi Major,

Sorry for the late reply. I thank you for the help.

No, I know how to select the node, and based on the link I posted, that helped me to create the self click on the node.

Once again, thank you for your help.

Best regards
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 12:01 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.