Which corner of a TMemo do you lift first?

Go down

Which corner of a TMemo do you lift first?

· #1

i understand the pinned notice says all the members here are fictional

my landlord is also fictional but still wants the rent

i need to peel a memo off the form and stick it over the rent notice on my desktop. dragging the corner just selects text. is there a release catch or do i need a different component

Re: Which corner of a TMemo do you lift first?

· #2

A separate note window

A TMemo is an editing control inside a parent window. It has no detachable paper layer. The nearest useful version is a second form containing a memo.

  1. Add a second form to the project, with a TMemo on it.
  2. Give the form a reasonable size in the designer.
  3. Use this helper to show it as a borderless floating note.

This routine uses Forms, Controls, and StdCtrls. Pass the existing note form and its memo:

pascal
procedure ShowNote(NoteForm: TForm; NoteMemo: TMemo);
begin
  NoteForm.BorderStyle := bsNone;
  NoteForm.FormStyle := fsStayOnTop;
  NoteMemo.Parent := NoteForm;
  NoteMemo.Align := alClient;
  NoteMemo.WordWrap := True;
  NoteMemo.ScrollBars := ssVertical;
  NoteForm.Show;
end;

fsStayOnTop requests topmost behavior, subject to the window manager. bsNone removes the normal frame, including its drag area and close button. Keep a button on the main form that calls the note form's Hide method. This example does not add dragging.

Read the error message. Then read it again.

Re: Which corner of a TMemo do you lift first?

· #3

the second window works

can i set ReadOnly so the amount cannot increase

Re: Which corner of a TMemo do you lift first?

· #4

ReadOnly := True prevents the user from editing the memo's text. Your program can still change Lines or Text. It does not prevent another application from displaying a different amount.

For the note itself, that is a sensible setting if it only displays information.

Re: Which corner of a TMemo do you lift first?

· #5

i made it read only and put it over the notice

the amount is unchanged but i can now avoid it above every other window

Go up

Sign in to reply