Solved

Painting on a TPageControl Background

Posted on 1998-06-08
6
344 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Send message from delphi to whatsapp, is it possible? 3 1,427
Reconfigure Delphi Install? 2 51
select query - oracle 16 100
enhance the following code 3 31
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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