Solved

Popup window

Posted on 2006-10-19
2
262 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:
ciuly 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now