• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

Popup window

Hi all,

I m working on delphi5. I want to create small popup help window for selected text on my TRichEdit box on my form, just like there is Ctrl <Space> help in delphi for veiwing the syntax of command. The help should be at location just near the selected text. I searched on net for any package available for popup windows but unfortunately cant find the right one. How could i create such popup window ? or if there is any free s/w package available for this on net?

Regards
SJan
0
Asmitagoyal
Asked:
Asmitagoyal
1 Solution
 
2266180Commented:
that is not exactly a popuop window. what delphi shows up is actually some listbox. if you want the same, then all you have to do is something like this:

procedure TForm1.RichEdit1KeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
var p:tpoint;
begin
  if (key = VK_SPACE) and (ssCtrl in shift) then
  begin
    RichEdit1.Perform(EM_POSFROMCHAR,integer(@p),richedit1.SelStart);
    listbox1.visible:=true;
    with p do
    begin
      listbox1.left:=RichEdit1.left+X;
      listbox1.top:=RichEdit1.top+y;
    end;
  end;
end;

of course you need to further adapt this code to fit any possible position of the listbox on the screen and to hide the listbox when you don't need it anymore. if you are to position according to selection, then use something like: RichEdit1.Perform(EM_POSFROMCHAR,integer(@p),richedit1.SelStart+richedit1.sellength);
0
 
AsmitagoyalAuthor Commented:
Thanks !! it works !!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now