Board index » delphi » Change Memo margins with Memo1.perform(EM_SETRECT,0,MyRect)

Change Memo margins with Memo1.perform(EM_SETRECT,0,MyRect)

Delphi's TMemo margin can be changed, apparantly, using the
SendMessage(Memo1.hanle,EM_SETRECT...) or Memo1.perform.  

What Delphi's API documentation says they want is this:

- The command to set the new rectangle, EM_SETRECT,
- Then 0 (word parameter) and
- Then a "reference" to a TRect structure in the longint parameter.

TRect is defined as desired:

var MyRect
begin
   MyRect.left:= 100
   MyRect.right:= 100
   MyRect.top:= 100
   MyRect.bottom:= 100

The compiler says type mismatch.  Reason: TRect is certainly not a
longint. Is one supposed to "convert" TRect into a longint. How?

How do we send the TRect in the SendMessage or Perform() command?

Email me. I appreciate it and reply to every email.
Matthew

 

Re:Change Memo margins with Memo1.perform(EM_SETRECT,0,MyRect)


Delphi's TMemo margin can be changed, apparantly, using the
SendMessage(Memo1.hanle,EM_SETRECT...) or Memo1.perform.  

What Delphi's API documentation says they want is this:

- The command to set the new rectangle, EM_SETRECT,
- Then 0 (word parameter) and
- Then a "reference" to a TRect structure in the longint parameter.

TRect is defined as desired:

var MyRect
begin
   MyRect.left:= 100
   MyRect.right:= 100
   MyRect.top:= 100
   MyRect.bottom:= 100

The compiler says type mismatch.  Reason: TRect is certainly not a
longint. Is one supposed to "convert" TRect into a longint. How?

How do we send the TRect in the SendMessage or Perform() command?

Email me. I appreciate it and reply to every email.
Matthew

Re:Change Memo margins with Memo1.perform(EM_SETRECT,0,MyRect)


I think like this :

longint(TRect declaration)

???

Jeremy

Other Threads