Recent

Author Topic: SOLVED!! Getting an image on top of component  (Read 445 times)

Badger

  • Full Member
  • ***
  • Posts: 119
SOLVED!! Getting an image on top of component
« on: August 08, 2022, 09:50:59 am »
I have an image and Rich Memo on a panel. (see code). No matter how I try, I can't get the image to appear on top of the memo. Can anyone help?  (You'll have to load the picture yourself)
Code: Pascal  [Select][+][-]
  1. object Form1: TForm1
  2.   Left = 375
  3.   Height = 240
  4.   Top = 237
  5.   Width = 427
  6.   Caption = 'Form1'
  7.   ClientHeight = 240
  8.   ClientWidth = 427
  9.   LCLVersion = '2.0.10.0'
  10.   object Panel1: TPanel
  11.     Left = 88
  12.     Height = 152
  13.     Top = 32
  14.     Width = 247
  15.     Caption = 'Panel1'
  16.     ClientHeight = 152
  17.     ClientWidth = 247
  18.     TabOrder = 0
  19.     object Image1: TImage
  20.       Left = 40
  21.       Height = 90
  22.       Top = 16
  23.       Width = 90
  24.     end
  25.     object RichMemo1: TRichMemo
  26.       Left = 106
  27.       Height = 66
  28.       Top = 58
  29.       Width = 118
  30.       HideSelection = False
  31.       Lines.Strings = (
  32.         'RichMemo1'
  33.       )
  34.       TabOrder = 0
  35.       ZoomFactor = 1
  36.     end
  37.   end
  38. end      
  39.  
« Last Edit: August 08, 2022, 01:27:36 pm by Badger »
Badger

If at first you don't succeed - you're running about average!

I'm using Windows 10 Lazarus v2.0.10

HeavyUser

  • Sr. Member
  • ****
  • Posts: 397
Re: Getting an image on top of component
« Reply #1 on: August 08, 2022, 11:22:39 am »
Its not possible. You can put the TImage in the richmemo by setting its parent to it but that's about it.

Badger

  • Full Member
  • ***
  • Posts: 119
Re: Getting an image on top of component
« Reply #2 on: August 08, 2022, 12:01:18 pm »
Nup!  I had tried that as it would have sort of solved my problem.  But if you try to do it at design time it throws the Image onto the main form.  If you try to do it at run time, you get an error message that Control of  Class 'TRichMemo' can't have control of class 'TImage' as a child.

Basically what I want to do is have a RichMemo which is being used as part of an invoice and have an image with text on its canvas representing Electronic Banking Data which the user can make visible if required and move to the normal position under the signature or anywhere else suitable within the memo.
Badger

If at first you don't succeed - you're running about average!

I'm using Windows 10 Lazarus v2.0.10

wp

  • Hero Member
  • *****
  • Posts: 10296
Re: Getting an image on top of component
« Reply #3 on: August 08, 2022, 01:00:59 pm »
Put the image into an autosized frameless panel.

Badger

  • Full Member
  • ***
  • Posts: 119
Re: Getting an image on top of component
« Reply #4 on: August 08, 2022, 01:26:54 pm »
Quote
Put the image into an autosized frameless panel.

Thank you - works perfectly

So much to learn - so little time!!!!!!
Badger

If at first you don't succeed - you're running about average!

I'm using Windows 10 Lazarus v2.0.10

 

TinyPortal © 2005-2018