Solved

Popup window

Posted on 2006-10-19
2
265 Views
Last Modified: 2010-04-05
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
Comment
Question by:Asmitagoyal
2 Comments
 
LVL 28

Accepted Solution

by:
2266180 earned 250 total points
ID: 17771906
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
 

Author Comment

by:Asmitagoyal
ID: 17833002
Thanks !! it works !!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question