Solved

Painting on a TPageControl Background

Posted on 1998-06-08
6
362 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Spellcheck in Webbrowser 1 77
Help on project with Soap 10 70
tidtcpserver connection lost handle 2 124
How to save the image in the .cds File ClientDataSet? 1 42
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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