Solved

Painting on a TPageControl Background

Posted on 1998-06-08
6
337 Views
Last Modified: 2010-04-04
I want to be able to paint an image onto the blank panel of a TPageControl, so that a wallpaper will show if no tabbed sheets are present, in a similar way to trapping the WM_ERASEBACKGROUND message and painting on the MDI parent.

The page control doesn't seem to have any properties or methods that will permit this.

Ross McMillan
0
Comment
Question by:rossmcm
  • 4
  • 2
6 Comments
 
LVL 1

Accepted Solution

by:
michaue earned 100 total points
ID: 1351510
Put a TImage control on the TPageControl with a image in the Picture property and then just make the TImage visible or invisible as you need it to be shown.
0
 

Author Comment

by:rossmcm
ID: 1351511
Doesn't work for me.  Sure, you can place an image on a tab sheet of the page control, but you can't place an image on the page control.  My app starts up with an empty page control and this is where I want the BMP to display.  When a tabbed page is added at run-time the BMP should then be obscured.  If the tabbed page is removed the BMP should then reappear.
0
 
LVL 1

Expert Comment

by:michaue
ID: 1351512
Why don't you just put the TImage underneath the TPageControl with the same size.  When no tabbed pages is active you can make the TPageControl.Visible := False and then show the TImage.  Give the users a button or something to add the first page eg.

Hope it works.

PS You can even put the TImage on a TPanel to give the same effect as the TPageControl
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:michaue
ID: 1351513
Well, did it work that way....

Hope it did, because there's always a way around any programming bug!


0
 

Author Comment

by:rossmcm
ID: 1351514
OK, that works, but you still need to check PageCount and assign to the Visible property every time the tab sheets might have been added or removed.  


0
 
LVL 1

Expert Comment

by:michaue
ID: 1351515
Well that's every programmer I know's problem ...  But that's life.  ;-\

Hope the rest of your system works OK.

Have Fun.  Elfrieda :-}
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

919 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

21 Experts available now in Live!

Get 1:1 Help Now